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!
What is the best way to handle Custom Record (CRUD) in a Suitelet?
Hello everyone,
I would like your opinion to know if I'm using the best way to do the following:
[LIST]
[*]Open a Suitelet with a Button from Sales Order
[/LIST] For that step, I created a button in a UserEvent script in beforeLoad(context) method linked to Sales Order , my button call a function in a linked ClientScript:
function addButton(thisForm){ thisForm.clientScriptModulePath = "../folderPath/myClientScript.js"; thisForm.addButton({ id: "custpage_myButton", label: "Open Suitelet", functionName: "loadCustomRecordInSuitelet" }); }Then, the ClientScript triggers the opening of the Suitelet with this function:
function loadCustomRecordInSuitelet(){ var soRec = currentRecord.get(); var slUrl = url.resolveScript({ scriptId: "customscript_mysuitelet_script_id", deploymentId: "customdeploy_mysuitelet_script_deploy_id", params: {rectype: soRec.type, recid: soRec.id} }); window.open(slUrl,'popUpWindow','height=800,width=1200,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes'); } 0