Page 1 of 1

Different behaviour of Run button according to nuIsChanged

Posted: Mon Apr 05, 2021 5:51 am
by absalom
I have a Run button (for running a report). I would like to make it run the following code:

Code: Select all

    if(nuIsChanged()) {
        nuMessage(["Warning"]);
    } else { nuRunReport("FR0"); }
which I can put in "Custom Code" of the object, but nuBuilder wants to still have something in the Run tab.

How can I do for achieving the expected result?

Re: Different behaviour of Run button according to nuIsChang

Posted: Mon Apr 05, 2021 7:14 am
by kev1n
Use a Type input and Input Type Button instead.

What does nuIsChanged do?

Re: Different behaviour of Run button according to nuIsChang

Posted: Mon Apr 05, 2021 10:04 am
by absalom
The relevant function actually is nuIsSaved() (tells if the current form has been changed without being saved or not).

Re: Different behaviour of Run button according to nuIsChang

Posted: Mon Apr 05, 2021 11:06 am
by kev1n
kev1n wrote:Use a Type input and Input Type Button instead.
Did that work?
kev1n wrote:The relevant function actually is nuIsSaved() (tells if the current form has been changed without being saved or not).
I was asking because nuIsChanged() does not exist in nuBuilder.
Preferably, avoid naming your own functions with a nu-prefix so that you can distinguish nuBuilder's functions from your own ones.

Re: Different behaviour of Run button according to nuIsChang

Posted: Mon Apr 05, 2021 1:38 pm
by absalom
I found this function and assumed I could use it. It works perfectly. it seems to be defined in core/nucommon.js

Re: Different behaviour of Run button according to nuIsChang

Posted: Mon Apr 05, 2021 2:16 pm
by kev1n
nuIsSaved() is defined in core/nucommon.js but nuIsChanged() does not exist.