Memorized Transaction Definition
A memorized transaction is a transaction you set up to recur in NetSuite, such as recurring journal entries. Memorized transactions eliminate data entry and serve as useful reminders. A memorized transaction consists of two parts:
-
The Memorized Transaction Template defines the transaction to be created.
-
The Memorized Transaction Definition sets the parameters for when to create the transaction, whether they are recurring, and how many transactions to create.
Memorized transaction templates and definitions must be created in the NetSuite user interface, but existing memorized transaction definitions can be called using SuiteScript.
The internal ID for this record is memdoc
. Note that this record is a search record only. You cannot create or copy this record.
See the SuiteScript Records Browser for all internal IDs associated with this record.
When you memorize a transaction, you set up the transaction to recur over time. You choose whether the transaction automatically posts or if you are reminded to post it. You also set the frequency the transaction should occur and set posting options. You can specify that the transaction should recur forever or a set number of times.
When you edit or delete a memorized transaction, the change is tracked on the system notes of the memorized transaction.
The following are limitations for posting memorized transactions in locked and closed periods:
-
A user must have the Override Period Restrictions permission to enable the Allow Posting in Locked Period option for a memorized transaction. When this option is enabled, memorized transactions can post in locked periods even if users initiating these transactions do not have the Override Period Restrictions permission.
-
Transactions can never be posted in closed periods. If the posting date for a memorized transaction is in a period that has been closed, it is posted to the next open period.
In NetSuite, you can memorize the following transactions:
-
Checks
-
Credit Cards
-
Purchase Orders
-
Bills
-
Sales Orders
-
Invoices
-
Estimates
-
Cash Sales
-
Journal Entries
-
Statement Charges
-
Work Orders
-
Purchase Requisitions
-
Transfer Orders
-
Opportunities
-
Custom Transactions
For help working with this record in the UI, see the following articles:
Supported Script Types
Memorized transaction definitions are supported in client and server SuiteScript.
Automatically-created transactions do not support server scripting.
Supported Functions
Memorized transaction definitions support only the Read, Update, Delete, and Search functions.
Usage Notes
Be aware of the following:
-
The System Notes and Transaction subtabs have not been exposed and cannot be used in scripts.
-
Transforming memorized transaction definition records into other types of records is not supported.
-
This record has one subrecord: a list with record ID “customdates”.
-
You cannot call nlapiCreateRecord with client scripts using memorized transaction definitions.
-
Scripts which run when a transaction is created may not work as expected if the transaction is automatically created from a memorized transaction. For example, you may have a script which runs when you save a purchase order. However, the script will not run if the purchase order was created from a memorized transaction definition which has “Automatic” set in its Action field.
For information about scripting with this record in SuiteScript, see the following help topics:
Sample Code
Memorized transaction definitions can only be created in the NetSuite user interface. The example script below first loads an existing memorized transaction definition with ID 2. Then, it sets the Action field to “Reminder”, and sets the Next Transaction Date in the Custom Dates subtab to 12/12/2020. It saves this date, and then saves the memorized transaction definition.
var r = nlapiLoadRecord('memdoc', 2)
r.setFieldValue('action', 'REMINDER')
r.selectNewLineItem('customdates')
r.setCurrentLineItemValue('customdates', 'nextdate', '12/12/2020')
r.commitLineItem('customdates')
var id = nlapiSubmitRecord(r);