Thursday, July 11, 2019

Create a 'note' attached on a Support Case using SuiteScript

In order to create a User Note attached on a Support Case, 'activity' field must be specified, which holds the Internal ID of the latter and builds the reference between the two.

Below is a sample to get it done:

     var note = nlapiCreateRecord('note');

     note.setFieldValue('activity', supportCaseId);

     note.setFieldValue('note', nlapiGetFieldValue('incomingmessage'));
     note.setFieldValue('title', 'Some Title');
     nlapiSubmitRecord(note);

As of this point in time, 'activity' is not yet documented as part of SuiteScript Records Browser and thus, not considered as officially supported.  This code snippet works, but only recommended to use for development and/or testing purposes.

Enhancement# 280389 (SSS/CSS > Support/Document 'activity' field on 'note' record for scripting) is already in place to make it become part of the SuiteScript Records Browser.

No comments:

Post a Comment