Welcome to the nuBuilder Forums!

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

RECORD_ID vs record_id

Questions related to using nuBuilder Forte.
Post Reply
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

RECORD_ID vs record_id

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

Re: RECORD_ID vs record_id

Unread post 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#";
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: RECORD_ID vs record_id

Unread post by vario »

OK. So I can rely on RECORD_ID being the procedure name when called from an action button?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: RECORD_ID vs record_id

Unread post 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?
honza1965
Posts: 20
Joined: Wed Apr 28, 2021 9:19 pm
Has thanked: 1 time
Been thanked: 1 time

Re: RECORD_ID vs record_id

Unread post by honza1965 »

The great code above ! ! ! Thanks Kevin
Post Reply