Can anyone help me with this task? I need create a...
# suitescript
s
Can anyone help me with this task? I need create an exception so that the button works even if the record is locked
b
You need to do better at explaining what your problem is
s
I made a post earlier talking about it. But the problem is that I need a button to keep working even though the registry is locked. This button is only for printing, and I want it to work with the registry locked. The record is blocked by workflow, but I need to create an exception for this button to work anyway.
b
its clear what you want, but not clear what issues you are facing
you have shared 2 versions of your code, with the first looking like it could work and the second having no chance
s
In the second code, I was trying to create a condition for my problem to be solved. Trying, first, to load a record, then search for the button by ID and create a condition for it to continue printing even with the record locked. I'm new to suitescript. I'm new to suitescript, that's why things get confusing. I'm trying, sorry
b
again, you still arent describing any problem
does your button even appear on your form?
are you getting error messages
is anything happening at all
describe where you are stuck instead of what you are trying to do
s
They explained it to me better now. In fact, the print button doesn't work because the registration is locked. He understands?
Sorry, I didn't even understand the problem. It was only now that they explained it to me better
b
its getting boring asking the same questions
does your button even appear on your form?
are you getting error messages
is anything happening at all
you are going to have huge problems fixing a problem if you cant reproduce it yourself
s
Yes, the button appears
Sorry. Stay calm. i'm new at this
b
button appearing on the form means that the user event script is doing its job
you are looking in the wrong place for problems
s
It is not printing. The button exists, it appears. However, it does not print. It doesn't perform a function...there isn't a function for that. Correct?
b
Copy code
form.clientScriptModulePath = "./rsc_client_pdf_pedido_compra.js";
form.addButton({
  id: "custpage_pdf_btn",
  label: "Imprimir",
  functionName: "openPdf",
});
the functionName usually refers to a key whose value is a function
😄 1
usually added in the client script
😄 1
s
Sorry for the inconvenience.
Hmmm, I understand
So I create a function with the value of this functionName? Correct?
b
a lot of what you have described so far has been that an existing solution that someone else wrote isnt working
👍 1
so you would go to the client script to see what it does
👍 1
s
Okay. Thanks