Welcome to the nuBuilder Forums!

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

Trying to run a procedure from a button Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
hering
Posts: 10
Joined: Sun Apr 09, 2023 12:54 pm
Has thanked: 8 times
Been thanked: 1 time

Re: Trying to run a procedure from a button

Unread post by hering »

Hello,
Searching the forum I came across this thread. I will try to use this advice, but not working.
I'm greenhorn.

I need to save the user to the database who ran the report.

I've created a run button that launches a report.

In "Custom Code" with "Event: onclick" I typed JavaScript:

Code: Select all

nuRunPHP(save_usr_przew_o)
Procedure PHP "save_usr_przew_o":

Code: Select all

nuRunQuery("UPDATE zlecenie SET zlc_przewodnik_o = '#USER_NAME#' WHERE zlc_id = '#zlc_id#';");
but I also use it for testing:

Code: Select all

nuRunQuery("UPDATE zlecenie SET zlc_przewodnik_o = test WHERE zlc_id = '#zlc_id#';");
I'm afraid, I need help.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Trying to run a procedure from a button

Unread post by kev1n »

Hi,

Try:

Code: Select all

nuRunPHPHidden('save_usr_przew_o', 0)
hering
Posts: 10
Joined: Sun Apr 09, 2023 12:54 pm
Has thanked: 8 times
Been thanked: 1 time

Re: Trying to run a procedure from a button

Unread post by hering »

Thank You very much kev1n.

Your advice works after minor changes to the other entries.
In admin mode I used word "test" without apostrophe - there was a mistake.

Now works fine.

In user mode must set access level for procedure ;-)
Post Reply