Sim Greenbaum
12/06/2021, 7:54 PMvar objRecord = currentrecord.get();
var wfsshipmenid = objRecord.getValue({ fieldId: "custbody19" });
console.log(wfsshipmenid);
Sandii
12/06/2021, 8:00 PMSim Greenbaum
12/06/2021, 8:04 PMSim Greenbaum
12/06/2021, 8:04 PMif (context.type === context.UserEventType.VIEW && check == true) {
context.form.clientScriptModulePath = "./wfsscript.js";
context.form.addButton({
id: "custpage_clickme",
label: "Get WFS Box label",
functionName: `wfssuitelet()`,
});
}
alien4u
12/06/2021, 8:19 PMSandii
12/06/2021, 8:19 PMvar someInfo = // your normal getValue call
then
functionName: 'wfssuitelet(someInfo)'
It's sort of a confusing way to do it, I think just loading the record in the client script is more clear what is going onSim Greenbaum
12/06/2021, 8:22 PMSim Greenbaum
12/06/2021, 8:22 PMbootstrap.js:184 Uncaught ReferenceError: someInfo is not defined
Sandii
12/06/2021, 8:23 PMsomeinfo
in there, you need to put whatever value you want in thereSim Greenbaum
12/06/2021, 8:23 PMif (context.type === context.UserEventType.VIEW && check == true) {
var someInfo = "testingonly";
context.form.clientScriptModulePath = "./wfsscript.js";
context.form.addButton({
id: "custpage_clickme",
label: "Get WFS Box label",
functionName: "wfssuitelet(someInfo)",
});
}
Sandii
12/06/2021, 8:23 PMSandii
12/06/2021, 8:24 PM"wfssuitelet(" + someInfo + ")"
Sim Greenbaum
12/06/2021, 8:27 PMSim Greenbaum
12/06/2021, 8:27 PMUncaught ReferenceError: testingonly is not defined
Sandii
12/06/2021, 8:27 PMSim Greenbaum
12/06/2021, 8:29 PMfunctionName: `wfssuitelet(${someInfo})`
Sandii
12/06/2021, 8:32 PM'wfssuitelet("testingonly")'
should work perfectly fine if your value is just a stringSandii
12/06/2021, 8:32 PMSim Greenbaum
12/06/2021, 8:33 PMSandii
12/06/2021, 8:34 PMalien4u
12/06/2021, 8:35 PMSandii
12/06/2021, 8:35 PMalien4u
12/06/2021, 8:36 PMSim Greenbaum
12/06/2021, 8:37 PMSim Greenbaum
12/06/2021, 8:37 PMalien4u
12/06/2021, 8:38 PMSim Greenbaum
12/06/2021, 8:38 PMalien4u
12/06/2021, 8:39 PMvar soId = context.newRecord.id;
var href = url.resolveScript({
scriptId: 'customscript_sl_script_id',
deploymentId: 'customdeploy_sl_deploy_id',
params: {soId: soId}
});
context.form.addButton({
id: 'custpage_my_print_button',
label: 'Print',
functionName: '(document.getElementById("custpage_proforma_invoice").onclick = null); (window.location="' + href + '")'
});
Sandii
12/06/2021, 8:54 PMSim Greenbaum
12/06/2021, 8:55 PM