Sunday, February 17, 2019

SuiteScript > Create Journal Entry via scripting

This sample snippet demonstrates how you can create a standard Journal Entry via scripting.

var jeRec = nlapiCreateRecord('journalentry');
// debit line

jeRec.selectNewLineItem('line');
jeRec.setCurrentLineItemValue('line', 'account', 27);
jeRec.setCurrentLineItemValue('line', 'debit', 100);
jeRec.commitLineItem('line');

// credit line
jeRec.selectNewLineItem('line');
jeRec.setCurrentLineItemValue('line', 'account', 6);
jeRec.setCurrentLineItemValue('line', 'credit', 100);
jeRec.commitLineItem('line');

nlapiSubmitRecord(jeRec);


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

Oracle +NetSuite Inc. does not warrant, guarantee or make any representations regardingthe use, results of use, accuracy, timeliness or completeness of any data orinformation relating to the sample code. Oracle + NetSuite Inc. disclaims allwarranties, express or implied, and in particular, disclaims all warranties ofmerchantability, fitness for a particular purpose, and warranties related tothe code, or any service or software related thereto.

Oracle + NetSuite Inc. shall notbe liable for any direct, indirect or consequential damages or costs of anytype arising out of any action taken by you or others related to the samplecode.

No comments:

Post a Comment