CRMSDK Conversion

NetSuite is retiring commonly used mechanisms for sending emails and other communications; CRMSDK Templates and the SuiteScript function nlapiMergeRecord.

Starting with NetSuite 2015.1, which is rolling out in a few weeks, you will not be able to edit any CRMSDK email templates.

NetSuite has introduced ‘Scriptable Templates’ to replace the CRMSDK templates. The process to convert your existing CRMSDK templates to Scriptable templates is generally straightforward, but does create a NEW template instead of replacing the original. This means that after the conversion you must ensure that all processes, configurations, and enhancements in your account that used your old templates are updated to use the new templates.

nlapiMergeRecord, a SuiteScript function commonly used to send emails, is being deprecated as well.


All email, fax, system, and campaign email templates using CRMSDK tags will be completely deprecated with Version 2016 Release 1.

To convert a CRMSDK template to a scriptable template:


1. View the CRMSDK template you want to convert. You’ll know it’s a CRMSDK template because of the ‘Convert to Scriptable’ button shown while in View mode:


2. Assess where and how this template is used (manual process, SuiteScript, Workflow, etc)


3. Create update and test plan for converted template


4. Click Convert to Scriptable.


5. If this is an email template select the type of record the template is used for.


A new template record is created and the name is appended with (Converted).


6. Check the template to make sure all fields have been converted correctly.


1. You can view the template in Source mode to review any fields with hidden logic


7. Use the description field in the new template to note:


1. Purpose of email

2. Where and how it’s used

3. Email template (name and Internal ID) it is replacing


8. Click Save.


9. Follow test plan to ensure template is working properly


10. Complete update to new template

A few notes on specific tags:




To perform a mail merge with a scriptable email template:

1. Use nlapiCreateEmailMerger(templateId) to create an nlobjEmailMerger object. The function nlapiCreateEmailMerger(templateId) takes the record ID of a scriptable template as an argument. The object nlobjEmailMerger encapsulates the scriptable template.

2. var emailMerger = nlapiCreateEmailMerger(<templateId>);


3. Use the nlobjEmailMerger set methods to designate the records to perform the mail merge on.


4. emailMerger.setEntity(<entityType>, <customerId>);


5. emailMerger.setRecipient(<recipientType>, <recipientId>);


6. emailMerger.setSupportCase(<caseId>);


7. emailMerger.setTransaction(<transactionId>);


8. emailMerger.setCustomRecord(<recordType>, <recordId>);


9. Use the nlobjEmailMerger.merge() method to perform the mail merge. The merge() method returns an nlobjMergeResult object.


The nlobjEmailMerger.merge() method has a governance of 20 usage units.

var mergeResult = emailMerger.merge();

Send the email using nlapiSendEmai


nlapiSendEmail(-5, customerRecord.getFieldValue(’email’), mergeResult.getSubject(), mergeResult.getBody() , null, null, records);