N/task/accounting/recognition Module

Use the N/task/accounting/recognition module to merge revenue arrangements or revenue elements. A revenue arrangement is a transaction that records the details of a sale for the purposes of revenue allocation and recognition. The N/task/accounting/recognition module lets you combine revenue arrangements or revenue elements from multiple sources to represent a single contract obligation for revenue allocation and recognition.

                                   

You can use the recognition.create(options) method to create a merge task that combines entire revenue arrangements or individual revenue elements. This method returns a recognition.MergeArrangementsTask object (when merging revenue arrangements) or recognition.MergeElementsTask object (when merging revenue elements). After you obtain one of these objects, you can set its properties, such as the list of arrangements or elements to merge, the date on the merged revenue arrangement, whether to prospectively merge arrangements, and so on. You can use these properties to specify the same input data that you can specify when you merge revenue arrangements using the NetSuite UI. After you set its properties, you can submit the task for processing. Merge tasks are processed asynchronously.

You cannot merge more than 10,000 revenue elements at one time. An error is thrown in the script if you attempt to merge more than 10,000 revenue elements. For UI related limitations, see Limitations for Creating Transactions.

You can use the recognition.checkStatus(options) method to check the status of a submitted merge task. This method returns a recognition.MergeArrangementsTaskStatus object that describes the current status of the merge task (pending, processing, complete, or failed). This object represents the current status for either a recognition.MergeArrangementsTask or a recognition.MergeElementsTask. If the task completes successfully, this object includes the ID of the merged revenue arrangement record that was created. If the task fails, this object includes an error message that describes the failure.

To merge revenue arrangements or revenue elements using the N/task/accounting/recognition module, the following requirements must be met:

For more information about revenue arrangements, see the following help topics:

In This Help Topic

N/task/accounting/recognition Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

recognition.MergeArrangementsTask

Object

Server scripts

Encapsulates a task to merge all of the revenue elements from a specified list of revenue arrangements.

Use recognition.create(options) to create this object.

recognition.MergeArrangementsTaskStatus

Object

Server scripts

Encapsulates the current status of a submitted merge task.

Use recognition.checkStatus(options) to create this object.

recognition.MergeElementsTask

Object

Server scripts

Encapsulates a task to merge all of the specified revenue elements.

Use recognition.create(options) to create this object.

Method

recognition.checkStatus(options)

recognition.MergeArrangementsTaskStatus

Server scripts

Checks the status of a submitted merge task.

recognition.create(options)

recognition.MergeArrangementsTask | recognition.MergeElementsTask

Server scripts

Creates a merge task that combines entire revenue arrangements or individual revenue elements.

Use values in the recognition.TaskType enum to specify the type of merge task to create.

Enum

recognition.TaskStatus

enum

Server scripts

Holds the string values for supported merge task statuses.

This enum is used to represent the task status in a recognition.MergeArrangementsTaskStatus object.

recognition.TaskType

enum

Server scripts

Holds the string values for supported merge task types.

This enum is used to pass the task type argument to recognition.create(options).

MergeArrangementsTask Object Members

The following members are available for a recognition.MergeArrangementsTask object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

MergeArrangementsTask.submit()

number (read-only)

Server scripts

Submits the merge task for processing.

This method returns a task ID that uniquely identifies the merge task.

Property

MergeArrangementsTask.arrangements

Array<number | string> (read-only)

Server scripts

Holds an array of internal IDs of the revenue arrangement records to merge.

MergeArrangementsTask.contractAcquisitionDeferredExpenseAccount

number | string (read-only)

Server scripts

References the contract acquisition deferred expense account for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is the account specified by the accounting preference Contract Acquisition Deferred Expense Account in your account.

MergeArrangementsTask.contractAcquisitionExpenseAccount

number | string (read-only)

Server scripts

References the contract acquisition expense account for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is the account specified by the accounting preference Contract Acquisition Expense Account in your account.

MergeArrangementsTask.contractCostAccrualDate

JavaScript Date (read-only)

Server scripts

Describes the contract cost accrual date to use for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is today’s date.

MergeArrangementsTask.mergeResidualRevenueAmounts

boolean (read-only)

Server scripts

Indicates whether the revenue arrangements are merged prospectively. For more information about prospective merges, see Prospective Merges.

The default value is false.

MergeArrangementsTask.recalculateResidualFairValue

boolean (read-only)

Server scripts

Indicates whether to recalculate the fair value on residual elements when revenue arrangements are prospectively merged. For more information about prospective merges, see Prospective Merges.

This property can be set to true only if the MergeArrangementsTask.mergeResidualRevenueAmounts property is also set to true. The default value is false.

MergeArrangementsTask.revenueArrangementDate

JavaScript Date (read-only)

Server scripts

Describes the date of the new revenue arrangement.

The default value is today’s date.

MergeArrangementsTaskStatus Object Members

The following members are available for a recognition.MergeArrangementsTaskStatus object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

MergeArrangementsTaskStatus.errorMessage

string (read-only)

Server scripts

Holds an error message that describes the failure of the merge task. This property is valid only if the value of the status property is TaskStatus.FAILED.

MergeArrangementsTaskStatus.inputArrangements

number[] (read-only)

Server scripts

Holds an array of internal IDs of the revenue arrangement records to merge. This property is valid only if the merge task was created using a task type of TaskType.MERGE_ARRANGEMENTS_TASK.

MergeArrangementsTaskStatus.inputElements

number[] (read-only)

Server scripts

Holds an array of internal IDs of the revenue elements to merge. This property is valid only if the merge task was created using a task type of TaskType.MERGE_ELEMENTS_TASK.

MergeArrangementsTaskStatus.resultingArrangement

number | string (read-only)

Server scripts

References the internal ID of the new revenue arrangement that was created. This property is valid only if the value of the status property is TaskStatus.COMPLETE.

MergeArrangementsTaskStatus.status

string (read-only)

Server scripts

Represents the current status of the merge task.

This property uses values in the recognition.TaskStatus enum.

MergeArrangementsTaskStatus.submissionId

number | string (read-only)

Server scripts

References the submission ID of the merge arrangements bulk process.

MergeArrangementsTaskStatus.taskId

number | string (read-only)

Server scripts

Holds the task ID of the merge task. The task ID is assigned to the merge task when you call recognition.create(options).

MergeElementsTask Object Members

The following members are available for a recognition.MergeElementsTask object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

MergeElementsTask.submit()

number (read-only)

Server scripts

Submits the merge task for processing.

This method returns a task ID that uniquely identifies the merge task.

Property

MergeElementsTask.contractAcquisitionDeferredExpenseAccount

number | string (read-only)

Server scripts

References the contract acquisition deferred expense account for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is the account specified by the accounting preference Contract Acquisition Deferred Expense Account in your account.

MergeElementsTask.contractAcquisitionExpenseAccount

number | string (read-only)

Server scripts

References the contract acquisition expense account for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is the account specified by the accounting preference Contract Acquisition Expense Account in your account.

MergeElementsTask.contractCostAccrualDate

JavaScript Date (read-only)

Server scripts

Describes the contract cost accrual date to use for the new revenue arrangement. This property is valid only if the accounting preference Enable Advanced Cost Amortization is enabled. For more information, see Advanced Cost Amortization.

The default value is today’s date.

MergeElementsTask.elements

Array<number | string> (read-only)

Server scripts

Holds an array of internal IDs of the revenue element records to merge.

MergeElementsTask.revenueArrangementDate

JavaScript Date (read-only)

Server scripts

Describes the date of the new revenue arrangement.

The default value is today’s date.

Related Topics

General Notices