Page 1 of 2

Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 8:22 pm
by BoydG
Is there something special I need to do to get the nuPrintEditForm function to hide certain objects?

I've placed the following on a button onclick

nuPrintEditForm('ins_ord_pri_fill')

the print window is displayed, but it's not hiding the object.
On the console nuHide('ins_ord_pri_fill') and nuShow('ins_ord_pri_fill') will hide and show the button, but it won't hide it when passing it as a parameter to the nuPrintEditForm function

I'm on version V.4.5-2023.02.21.01

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 8:39 pm
by kev1n
Hi,

Pass the objects to hide as array:

Code: Select all

nuPrintEditForm(['ins_ord_pri_fill'])

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 8:44 pm
by BoydG
nope, that didn't work either, even tried with quotes
nuPrintEditForm("['ins_ord_pri_fill']")

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 8:53 pm
by kev1n
What type of object is it? If I run this JS in the User form, the Language field isn't shown in the preview window.

Code: Select all

nuPrintEditForm(['sus_language'])

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 9:01 pm
by BoydG
if open a user and then go to the console, copy and paste what your wrote.
the print preview screen still shows the language field in the print preview
Clipboard01.jpg

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 9:06 pm
by kev1n
That's odd. I tested it with Chrome, FF, Edge and in all 3 browser, the Language field is not shown in the preview screen.
(If relevant, tested with the latest nuBuilder. But IIRC, nuPrintEditForm() hasn't been updated in a while)

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 9:11 pm
by BoydG
I'll add some debugging code to that function in the nuForm.js and see if it's even hitting that procedure.
The documentation says it's also defined in nucommon.js but without the parameters.
Maybe it's hitting the wrong procedure.

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 9:17 pm
by kev1n
BoydG wrote: Fri May 12, 2023 9:11 pm The documentation says it's also defined in nucommon.js but without the parameters.
Wiki:
This function is defined in nuform.js

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 9:21 pm
by kev1n
Also make sure, that the function is not declared elsewhere but with different parameters, a different implementation.

https://streamable.com/mku176

Re: Can't get nuPrintEditForm to work

Posted: Fri May 12, 2023 10:58 pm
by BoydG
When I type
nuPrintEditForm
like you did on the console, I don't get the version with the parameters
I get the one in nucommon.js without the parameters

Any idea what could cause that?