Welcome to the nuBuilder Forums!

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

nuForm accesing object by name and not ID

Post your ideas & suggestions for new nuBuilder features or other improvements
Post Reply
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

nuForm accesing object by name and not ID

Unread post by Giu »

nuForm function works in this way:

Code: Select all

    nuForm('664e4e6451cfbe7', primaryKey, '', '', '1');
But there are a some of important issues using the ID instead of name.
- You can't identify wich form is called.
- You can't search forms by ID.
- You have to open the form, inspect it and see the iD to reference it.

I suggest to change for the unique name of the form.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuForm accesing object by name and not ID

Unread post by kev1n »

Unlike form codes, which may be subject to changes, IDs provide a stable reference point.

Despite the benefits of using IDs, I acknowledge the challenges mentioned regarding the identification and searchability of forms by their IDs alone.
To address these concerns, while maintaining the stability of using IDs and also backwards compatibility, nuForm() could be modified to accept a parameter in the format

Code: Select all

nuForm('code:form_code_here', primaryKey, '', '', '1')
What do you think?
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

Re: nuForm accesing object by name and not ID

Unread post by Giu »

I think this is so elegant
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuForm accesing object by name and not ID

Unread post by kev1n »

You can now find this update on Github.
Consider replacing your current nuform.php with the version from Github.

This update enables you to call a form using the traditional method, using the form ID:

Code: Select all

nuForm('62d91e8f4adbbc7 ', '-1', '', '', '1')
Alternatively, you can call a form using a first parameter that starts with "code:" followed by the form's code:

Code: Select all

nuForm('code:myformcode', '-1', '', '', '1')
:arrow: Documentation
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

Re: nuForm accesing object by name and not ID

Unread post by Giu »

Thanks
Post Reply