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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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