Page 1 of 1

RECORD_ID Problems

Posted: Tue May 04, 2021 9:07 am
by vario
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?

Re: RECORD_ID Problems

Posted: Tue May 04, 2021 9:16 am
by kev1n
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());

Re: RECORD_ID Problems

Posted: Tue May 04, 2021 9:24 am
by vario
Lower case is good! Should I go with lower case for all hash cookies? BTW, #RECORD_ID# does work in other procedures!

Re: RECORD_ID Problems

Posted: Tue May 04, 2021 9:46 am
by kev1n
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()

Re: RECORD_ID Problems

Posted: Wed May 05, 2021 9:07 am
by vario
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.

Re: RECORD_ID Problems

Posted: Wed May 05, 2021 9:37 am
by kev1n
Great - thanks for letting us know.