Saturday, June 8, 2019

SS > Update revenue Recognition template on Invoice

Please refer to below UE script deployed on an Invoice, triggered on After record submit :

function update() {

var id = nlapiGetRecordId();

var invoice = nlapiLoadRecord('invoice', id);

var intLine = invoice.getLineItemCount('item');

for (var j = 1; j <= intLine; j++)
{

invoice.setLineItemValue('item', 'revrecschedule' , j, 'xxx');  // Lists > Accounting > Revenue Recognition Schedules
invoice.setLineItemValue('item', 'amortizationtype' , j, 'STANDARD'); //  standard or variable
invoice.setLineItemValue('item', 'amortizationperiod', j, 2);
invoice.setLineItemValue('item', 'revrecstartdate', j, '11/30/2013');
invoice.setLineItemValue('item', 'revrecenddate' , j,'11/30/2014' );

// You can hardcode the value or have a custom field of type date and set the value of that field on end and start date
}
nlapiSubmitRecord(invoice);
}


DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Netsuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development 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 information relating to the sample code. Netsuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.

Netsuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.

No comments:

Post a Comment