Hi All,
I need some help with editing my existing script.
Currently I have 2 scripts with the following functions:
Script #1. Performs the role of the auto-numbering function, with prefix & numbering but allows me to reset the numbering to the number I require it to. Eg, with the turn of the new year I have reset it back to 1
Script #2. Converts a custom record into Purchase Order
I would like to make use of script #1 in script #2 when converting the custom record into the Purchase Order, to allow me to use my preferred prefix & numbering system in the purchase orders i create. Can someone help me with how the code should look like?
A sample of the PO creation script:
// create PO for each vendor
var recordPO = nlapiCreateRecord('purchaseorder');
recordPO.setFieldValue('entity', vendorId);
recordPO.setFieldValue('custbody24', joborder); //job order
recordPO.setFieldValue('location', location); //job order
recordPO.setFieldValue('trandate', nlapiDateToString(dateToday));
// search for line items with that vendor
var columnItems = new Array();
columnItems[0] = new nlobjSearchColumn('custrecord_qty');
columnItems[1] = new nlobjSearchColumn('custrecord_item');
Many thanks!