Friday, January 4, 2019

Create Intercompany Journal Entry via scripting


This sample snippet demonstrates how you can create an Intercompany Journal Entry via scripting.

 var jeRec = nlapiCreateRecord('intercompanyjournalentry');
 jeRec.setFieldValue('subsidiary', 28);
 jeRec.setFieldValue('tosubsidiary', 8);

 //debit line for subsidiary ID 28
 jeRec.selectNewLineItem('line');
 jeRec.setCurrentLineItemValue('line', 'linesubsidiary', 28);
 jeRec.setCurrentLineItemValue('line', 'account', 11);
 jeRec.setCurrentLineItemValue('line', 'debit', 100);
 jeRec.commitLineItem('line');
 
 //credit line for subsidiary ID 28
 jeRec.selectNewLineItem('line');
 jeRec.setCurrentLineItemValue('line', 'linesubsidiary', 28);
 jeRec.setCurrentLineItemValue('line', 'account', 10);
 jeRec.setCurrentLineItemValue('line', 'credit', 100);
 jeRec.commitLineItem('line');
 
 //debit line for subsidiary ID 8
 jeRec.selectNewLineItem('line');
 jeRec.setCurrentLineItemValue('line', 'linesubsidiary', 8);
 jeRec.setCurrentLineItemValue('line', 'account', 11);
 jeRec.setCurrentLineItemValue('line', 'debit', 100);
 jeRec.commitLineItem('line');
 
 //credit line for subsidiary ID 8
 jeRec.selectNewLineItem('line');
 jeRec.setCurrentLineItemValue('line', 'linesubsidiary', 8);
 jeRec.setCurrentLineItemValue('line', 'account', 10);
 jeRec.setCurrentLineItemValue('line', 'credit', 100);
 jeRec.commitLineItem('line');
 
 nlapiSubmitRecord(jeRec);


Add this snippet to the intended function and script type. Deploy this depending on how and when the user wants to send the email.


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.

1 comment:

  1. how we can tag the IC customer and IC vendor at line level.

    ReplyDelete