Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Different behaviour of Run button according to nuIsChanged

Questions related to using nuBuilder Forte.
Post Reply
absalom
Posts: 25
Joined: Sat Apr 03, 2021 3:50 pm

Different behaviour of Run button according to nuIsChanged

Unread post 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?
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Different behaviour of Run button according to nuIsChang

Unread post by kev1n »

Use a Type input and Input Type Button instead.

What does nuIsChanged do?
absalom
Posts: 25
Joined: Sat Apr 03, 2021 3:50 pm

Re: Different behaviour of Run button according to nuIsChang

Unread post by absalom »

The relevant function actually is nuIsSaved() (tells if the current form has been changed without being saved or not).
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Different behaviour of Run button according to nuIsChang

Unread post 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.
absalom
Posts: 25
Joined: Sat Apr 03, 2021 3:50 pm

Re: Different behaviour of Run button according to nuIsChang

Unread post by absalom »

I found this function and assumed I could use it. It works perfectly. it seems to be defined in core/nucommon.js
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Different behaviour of Run button according to nuIsChang

Unread post by kev1n »

nuIsSaved() is defined in core/nucommon.js but nuIsChanged() does not exist.
Post Reply