Issue In a vendor return record, a client script is deployed. In the pageInit of the script, the code intended to set the inventory details for the item lines. But when the pageInit was triggered, an error occurred saying selectNewLine is not a function when the script was trying to set the inventory detail. Also,… Continue reading Inventory Detail Setting using script
Tag: subrecord
Access Sublists and a Subrecord from a Record
Sample code to access sublists and a subrecord from a record. /** * @NApiVersion 2.x */ require([‘N/record’], function(record) { function createPurchaseOrder() { var rec = record.create({ type: ‘purchaseorder’, isDynamic: true }); … Continue reading Access Sublists and a Subrecord from a Record
Populate Shipping Address Subrecord Values in Transactions Using Script
Scenario: User wants to set the values of Shipping Address subrecord using Client Script for existing records. Solution: /** * * @NApiVersion 2.x * @NScriptType ClientScript * */ define([‘N/record’, ‘N/currentRecord’, ‘N/runtime’], function pageInit(scriptContext) { try { var recordid = scriptContext.currentRecord.id; var recordtype = scriptContext.currentRecord.type; var rec = record.load({ type: recordtype, id: recordid, isDynamic: true });… Continue reading Populate Shipping Address Subrecord Values in Transactions Using Script