Is there any way to unlock registry by suitescript?

My print button does not perform its function. The reason: The record is blocked by workflow. Is there any way to enable the button with the registry locked, or unlock the registry? The button appears, but it doesn’t perform the print function. What could be wrong?

The code is not wrong and the button appears on the form. The problem is, it’s not printing the screen. What’s wrong or what can be done about it?


 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @NModuleScope SameAccount
 define(['N/runtime', 'N/https'],
 function(runtime, https) {
     function beforeLoad(context) {
         if (context.type === context.UserEventType.VIEW) {
             const form = context.form;
             form.clientScriptModulePath = './rsc_client_pdf_pedido_compra.js';
                 id: 'custpage_pdf_btn',
                 label: 'Imprimir',
                 functionName: 'openPdf'
             // form.clientScriptModulePath = './ISP_Customer_CS.js';
     return {
         beforeLoad: beforeLoad
Rookie Asked on July 28, 2021 in SuiteScript.
Add Comment
1 Answer(s)

Could you please also share:rsc_client_pdf_pedido_compra.js



Advanced Answered on August 3, 2021.

Hey, Chris

This is the code:

* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
define([‘N/currentRecord’, ‘N/url’],
function(currentRecord, url) {

function saveRecord(context) {
return true;

function openPdf() {
const recordId = currentRecord.get();
scriptId: ‘customscript_rsc_st_pdf_pedido_compra’,
deploymentId: ‘customdeploy_rsc_st_pdf_pedido_compra’,
params: {


return {
‘saveRecord’: saveRecord,
‘openPdf’: openPdf


on August 3, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor