Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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++)