Different behaviour of Run button according to nuIsChanged

Questions related to using nuBuilder Forte.

Different behaviour of Run button according to nuIsChanged

Unread postby absalom » Mon Apr 05, 2021 1:21 pm

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?
absalom
 
Posts: 22
Joined: Sat Apr 03, 2021 11:20 pm
nuBuilder Version: 4.5

Re: Different behaviour of Run button according to nuIsChang

Unread postby kev1n » Mon Apr 05, 2021 2:44 pm

Use a Type input and Input Type Button instead.

What does nuIsChanged do?
kev1n
nuBuilder Team
 
Posts: 1622
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Different behaviour of Run button according to nuIsChang

Unread postby absalom » Mon Apr 05, 2021 5:34 pm

The relevant function actually is nuIsSaved() (tells if the current form has been changed without being saved or not).
absalom
 
Posts: 22
Joined: Sat Apr 03, 2021 11:20 pm
nuBuilder Version: 4.5

Re: Different behaviour of Run button according to nuIsChang

Unread postby kev1n » Mon Apr 05, 2021 6:36 pm

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.
kev1n
nuBuilder Team
 
Posts: 1622
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Different behaviour of Run button according to nuIsChang

Unread postby absalom » Mon Apr 05, 2021 9:08 pm

I found this function and assumed I could use it. It works perfectly. it seems to be defined in core/nucommon.js
absalom
 
Posts: 22
Joined: Sat Apr 03, 2021 11:20 pm
nuBuilder Version: 4.5

Re: Different behaviour of Run button according to nuIsChang

Unread postby kev1n » Mon Apr 05, 2021 9:46 pm

nuIsSaved() is defined in core/nucommon.js but nuIsChanged() does not exist.
kev1n
nuBuilder Team
 
Posts: 1622
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: GlenMcCabe and 25 guests