XochisSketches
03/31/2021, 3:05 PMbattk
03/31/2021, 3:12 PMbattk
03/31/2021, 3:14 PMfunctionName:'button(123)'
XochisSketches
03/31/2021, 3:16 PMbattk
03/31/2021, 3:20 PMXochisSketches
03/31/2021, 4:18 PMbattk
03/31/2021, 4:19 PMXochisSketches
03/31/2021, 4:20 PMvar form = context.form;
var scriptURL = url.resolveScript({
scriptId: 'customscript_sc_bs_docengine',
deploymentId: 'customdeploy1',
returnExternalUrl: true,
params: { "jrecid" : context.newRecord.id }
});
log.debug({
title: 'scriptURL',
details: scriptURL
});
form.addButton({
id: 'custpage_btn_call_docengine',
label: 'Test',
functionName: "openWindow(" + scriptURL + ");"
});
context.form.clientScriptModulePath = "SuiteScripts/Libraries/docengineclient.js"
XochisSketches
03/31/2021, 4:20 PMXochisSketches
03/31/2021, 4:21 PMXochisSketches
03/31/2021, 4:21 PM/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(["N/ui/dialog", "N/log"], function (dialog, log) {
function pageInit(context) {
// TODO
}
function openWindow(url) {
log.debug({
title: 'we made it',
details: url
});
window.open(url);
}
return {
pageInit: pageInit,
openWindow: openWindow
}
});
battk
03/31/2021, 4:21 PMbattk
03/31/2021, 4:22 PMXochisSketches
03/31/2021, 4:23 PMbattk
03/31/2021, 4:23 PMbattk
03/31/2021, 4:24 PMXochisSketches
03/31/2021, 4:32 PM