Discussions
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Join us
getting stuck at nlapiSubmitRecord
I'm trying to create a Transfer order after a scheduled search is performed on Sales orders which returns the internalids of SO. The problem is the code gets stuck at the point where SubmitRecord takes place. Can someone help me with this?
function createTransferOrder(orderId, itemsToTransfer, length)
{
//log("onAfterSubmit : createTransferOrder", "Creating new Transfer Order and Populating it");
var SPOILAGE = 32; // Spoilage Warehouse
var INHOUSE = 3; // Seattle Warehouse
var spoilquantity= 0;
var transferOrder = nlapiCreateRecord('transferorder');
//var recordtype= nlapiGetRecordType();
//transferOrder.setFieldValue("tranid", orderId);
transferOrder.setFieldValue('custbody_originating_ sales_order', orderId);
transferOrder.setFieldValue('location', INHOUSE);
transferOrder.setFieldValue('transferlocation', SPOILAGE);
var itemCount= transferOrder.getLineItemCount('item');
for (var i = 1; i <=length; i++)