Sunday, January 27, 2019

Sample Script to Create a Cart Line Message in Scriptable Cart & Checkout



Note: Refer to the SuiteAnswer Guide on how to attach the script in the form. 

Below is a sample script:

function customValidateLine(type)
{
          var itemID = nlapiGetCurrentLineItemValue ('item', 'item');
          if (itemID == '5')
          {
                    nlapiSetCurrentLineItemValue('item', 'custcol_message', 'This is the cart line Message');
          }
          else
          {
                    nlapiSetCurrentLineItemValue('item', 'custcol_message', '');                 return true;
          }
}

In the condition, If the Item (Internal ID = 5) is added to the cart, Then set or assign 'This is the cart line Message' as value of the Transaction Culomn Field (custcol_message)

To Deploy Script, see "Deploying and Running Scriptable Cart" in Online Help Guide.

Disclaimer: The sample code described herein is provided on an"as is" basis, without warranty of any kind, to the fullest extentpermitted by law. NetSuite Inc. does not warrant or guarantee the individualsuccess developers may have in implementing the sample code on theirdevelopment platforms or in using their own Web server configurations.

NetSuite Inc.does not warrant, guarantee or make any representations regarding the use,results of use, accuracy, timeliness or completeness of any data or informationrelating to the sample code. NetSuite Inc. disclaims all warranties, express orimplied, and in particular, disclaims all warranties of merchantability,fitness for a particular purpose, and warranties related to the code, or anyservice or software related thereto.

NetSuite Inc. shall not be liablefor any direct, indirect or consequential damages or costs of any type arisingout of any action taken by you or others related to the sample code.

 

No comments:

Post a Comment