Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Assembly Build: Afer upgrade can't setLineItemValue on Component Sublist Fails
Hi all,
We have a scheduled script that was working prior to the last upgrade and now it throws an error whenever it tries to set a line item value on the component sublist of an assembly build:
SCRIPT SNIPETTE:
function DoAssemblyBuilds(itemRecord, locationGroup) { try { var itemId = itemRecord.getId(); var itemMembers = new Array(); var memberCount = itemRecord.getLineItemCount('member'); for (var memberLine = 1; memberLine <= memberCount; memberLine++) { var memberItemId = itemRecord.getLineItemValue('member', 'item', memberLine); var memberItemQty = itemRecord.getLineItemValue('member', 'quantity', memberLine); var memberCost = nlapiLookupField('item', memberItemId, 'cost'); itemMembers.push({ 'id': memberItemId, 'qty': memberItemQty, 'cost': memberCost }); } for (var locationIndex in locationGroup) { var qty = -1 * locationGroup[locationIndex]['locationQty']; try { if (qty > 0) { var assemblyBuildRecord = nlapiCreateRecord('assemblybuild'); var buildId = null; assemblyBuildRecord.setFieldValue('item', itemId); assemblyBuildRecord.setFieldValue('location', locationGroup[locationIndex]['location']); assemblyBuildRecord.setFieldValue('quantity', qty); assemblyBuildRecord.setFieldValue('date', Date()); assemblyBuildRecord.setFieldValue('memo', 'Software Assembly Auto-Build'); for (var memberIndex = 0