`define(['N/runtime', 'N/https'],`  `function(runt...
# suitescript
s
define(['N/runtime', 'N/https'],
 
function(runtime, https) {
     
function beforeLoad(context) {
         
if (context.type === context.UserEventType.VIEW) {
             
const form = context.form;
             
const newRecord = context.newRecord;
             
form.clientScriptModulePath = './rsc_client_pdf_pedido_compra.js';
             
form.addButton({
                 
id: 'custpage_pdf_btn',
                 
label: 'Imprimir',
                 
functionName: 'openPdf'
             
});
             
// form.clientScriptModulePath = './ISP_Customer_CS.js';
         
}
     
}
     
return {
         
beforeLoad: beforeLoad
     
};
 
});
I need to allow a button to print even with the registry locked, Can you help me?
b
honestly that looks like it should run even if the record is locked by a workflow
s
I need the button to work even with the registry locked. Can you help me?
b
not sure what you mean by registry
s
I am new to suitescript. What I really wanted was to leave this print button working while the record or form was blocked. I think it's a form, I'm not sure, but at the moment I just need to create a form to get the button working. For example: The administrator does not want other people to edit the form, and this button to be enabled while registration is locked
e
i think he means “view” mode. what does the
openPdf
function look like?