Page 1 of 1

RECORD_ID vs record_id

Posted: Fri May 14, 2021 12:50 pm
by vario
This is revisit of a previous post...

I am having trouble with a php procedure which is called using nuRunPHPHidden. In my BE code i have

Code: Select all

if ('#RECORD_ID#' == '-1') nuRunPHPHidden('php_add_tcr');
and on an action button on the edit form I have

Code: Select all

nuAddActionButton('AddContract', 'Add Contract', 'nuRunPHPHidden("php_add_tcr")');
.
When called from BE only RECORD_ID is set, but from the action button record_id is set and RECORD_ID takes the name of the PHP procedure. My obvious workaround is to have two copies of the procedure, but will it be possible to resolve the matter and have consistent use of the hash?

Re: RECORD_ID vs record_id

Posted: Fri May 14, 2021 1:11 pm
by kev1n
You could retrieve the record Id like this in your PHP Procedure:

Code: Select all

$recordId = "#RECORD_ID#" == "php_add_tcr" ? "#record_id#" : "#RECORD_ID#";

Re: RECORD_ID vs record_id

Posted: Fri May 14, 2021 1:29 pm
by vario
OK. So I can rely on RECORD_ID being the procedure name when called from an action button?

Re: RECORD_ID vs record_id

Posted: Fri May 14, 2021 2:34 pm
by kev1n
vario wrote:OK. So I can rely on RECORD_ID being the procedure name when called from an action button?
Could you try it out and let us know your findings?

Re: RECORD_ID vs record_id

Posted: Wed Feb 16, 2022 9:43 pm
by honza1965
The great code above ! ! ! Thanks Kevin