RECORD_ID Problems

Questions related to using nuBuilder Forte.

RECORD_ID Problems

Unread postby vario » Tue May 04, 2021 4:37 pm

I am having problems with hash cookie RECORD_ID.
As in a previous post, for SQL in Display object I must enclose it in double quotes (why?), and now when I reference it in a PHP procedure it has the value of the procedure name.
I am calling the procedure from an Action Button defined in the form Javascript as:
Code: Select all
nuAddActionButton('AddContract', 'Add Contract', 'nuRunPHPHidden("php_add_tcr")');

I inserted the following at the top of the procedure and commented out the rest of the code:
Code: Select all
$js = "nuMessage('Record ID is #RECORD_ID#')";
nuJavascriptCallback($js);

The message displayed on the form is "Record ID is php_add_tcr". What is causing this?
vario
 
Posts: 55
Joined: Mon Dec 05, 2011 8:53 pm
Location: Newton Abbot, UK
nuBuilder Version: 4.5

Re: RECORD_ID Problems

Unread postby kev1n » Tue May 04, 2021 4:46 pm

As in a previous post, for SQL in Display object I must enclose it in double quotes (why?), and now when I reference it in a PHP procedure it has the value of the procedure name.


I'll have to check the sources.

The message displayed on the form is "Record ID is php_add_tcr". What is causing this?


Use #record_id# (lower case) instead. (It's a bit confusing to be honest...)

BTW: To see all Hash Cookies, you can run nuHash()

Code: Select all
nuDebug(nuHash());
kev1n
nuBuilder Team
 
Posts: 1696
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: RECORD_ID Problems

Unread postby vario » Tue May 04, 2021 4:54 pm

Lower case is good! Should I go with lower case for all hash cookies? BTW, #RECORD_ID# does work in other procedures!
vario
 
Posts: 55
Joined: Mon Dec 05, 2011 8:53 pm
Location: Newton Abbot, UK
nuBuilder Version: 4.5

Re: RECORD_ID Problems

Unread postby kev1n » Tue May 04, 2021 5:16 pm

vario wrote: BTW, #RECORD_ID# does work in other procedures!


When running them with nuRunPHPHidden() ?

If I'm not mistaken, #RECORD_ID# can be used in PHP BS, AS etc. events and #record_id# when using nuRunPHPHidden()
kev1n
nuBuilder Team
 
Posts: 1696
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: RECORD_ID Problems

Unread postby vario » Wed May 05, 2021 4:37 pm

OK thanks, I'll get used to forte soon! I think the double quotes issue may have been browser caching or some such because now working with single quotes.
vario
 
Posts: 55
Joined: Mon Dec 05, 2011 8:53 pm
Location: Newton Abbot, UK
nuBuilder Version: 4.5

Re: RECORD_ID Problems

Unread postby kev1n » Wed May 05, 2021 5:07 pm

Great - thanks for letting us know.
kev1n
nuBuilder Team
 
Posts: 1696
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: No registered users and 13 guests