MergeElementsTask Object Members in SuiteScript

The MergeElementsTask object in SuiteScript allows the merging of revenue elements, facilitating streamlined revenue recognition.

·3 min read·View Oracle Docs

TL;DR Opening

The MergeElementsTask object in SuiteScript is critical for merging specified revenue elements to streamline revenue recognition processes. This object encapsulates a task that enables developers to manage complex revenue arrangements within their NetSuite environments.

What is the MergeElementsTask?

The MergeElementsTask is part of the SuiteScript module for accounting and recognition, specifically designed to handle tasks that require the merging of revenue elements. By using this object, developers can create, manage, and submit tasks that facilitate the consolidation of multiple revenue elements into a single revenue arrangement.

Object Description

This object allows you to create a merge task through the recognition.create(options) method. The MergeElementsTask.elements property is required for the task to be valid, while other properties offer additional configuration options.

Key Members of MergeElementsTask

The MergeElementsTask object comprises various members, including methods and properties:

Member NameTypeDescription
MergeElementsTask.submit()number (read-only)Submits the merge task for processing and returns a task ID for identification.
MergeElementsTask.contractAcquisitionDeferredExpenseAccount`numberstring` (read-only)
MergeElementsTask.contractAcquisitionExpenseAccount`numberstring` (read-only)
MergeElementsTask.contractCostAccrualDateJavaScript Date (read-only)Specifies the cost accrual date for the new revenue arrangement, defaulting to today’s date and valid under certain conditions.
MergeElementsTask.elements`Array<numberstring>` (read-only)
MergeElementsTask.revenueArrangementDateJavaScript Date (read-only)Indicates the date of the new revenue arrangement, also defaulting to today’s date.

Example Syntax

Here’s how you might implement the MergeElementsTask in your SuiteScript:

suitescript
var recognitionTask = recognition.create({
taskType: recognition.TaskType.MERGE_ELEMENTS_TASK
});
recognitionTask.elements = elementsList;
var taskStatusId = recognitionTask.submit();

Supported Script Types

The MergeElementsTask is designed for use in server scripts within NetSuite, ensuring robust task performance and integration capabilities.

Governance

When executing the submit() method of the MergeElementsTask, be aware of governance limits. Each call can consume 20 units of governance.

Error Handling

  • WRONG_PARAMETER_TYPE: This error will trigger if an invalid date format is supplied for MergeElementsTask.contractCostAccrualDate or MergeElementsTask.revenueArrangementDate properties.

Who This Affects

  • Administrators: Manages revenue arrangements and task submissions.
  • Developers: Implements the MergeElementsTask functionality in custom scripts.

Key Takeaways

  • The MergeElementsTask is essential for merging revenue elements in SuiteScript.
  • It encapsulates properties needed for detailed revenue arrangement management.
  • It's important to handle date formats correctly to avoid parameter type errors.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

What properties are required to use the MergeElementsTask object?
The MergeElementsTask object requires the 'elements' property, which is an array of internal IDs for the revenue element records that are to be merged.
How can I submit a MergeElementsTask in SuiteScript and what does it return?
You can submit a MergeElementsTask using the 'submit()' method, which processes the merge task and returns a task ID for identification.
What are the governance implications when using the submit() method on a MergeElementsTask?
Executing the 'submit()' method consumes 20 units of governance, so it's important to consider this when designing scripts involving multiple submissions.
What potential error should I be aware of when working with date properties in MergeElementsTask?
Make sure to use the correct date format. If an invalid date format is supplied for 'contractCostAccrualDate' or 'revenueArrangementDate', a WRONG_PARAMETER_TYPE error will be triggered.
Source: MergeElementsTask Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Accounting

View all Accounting articles →