Welcome to the nuBuilder Forums!

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

Global Hash Cookies

Questions related to using nuBuilder Forte.
Post Reply
Whoopsadaisy
Posts: 1
Joined: Fri Dec 03, 2021 10:47 pm

Global Hash Cookies

Unread post by Whoopsadaisy »

This is my second day with nuBuilder.
So might be that I do not understand the concept of Global Hash Cookies.
I'm just trying to pass a value from one to another.
Therefore I put in the CustomeCode of form A the code:

Code: Select all

nuSetProperty('SIM_KEY', 'abc', true);
Also I add Run Object to open a second form B.
There I place in the CustomCode of Browse

Code: Select all

console.log("browse: " + nuGetProperty('SIM_KEY'));
and for Edit:

Code: Select all

console.log("edit: " + nuGetProperty('SIM_KEY'));
If the Run object in Form A is configured as Target 'New Breadcrumb',
I get browse: undefined on Browse and Edit Form.

If the Run object in Form A is configured as Target 'Current Breadcrumb',
I get "browse: abc" and when I click on a record to edit: "edit: undefined"

Btw. I get the same result when using nuSetProperty('SIM_KEY', 'abc'); in Form A.

I know that I can use sessionStorage for this, but from all explanation I've read
so far a Global Hash Cookie should achieve the same.

Where am I wrong?
Last edited by kev1n on Sat Dec 04, 2021 2:19 pm, edited 1 time in total.
Reason: Added Code tags
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Global Hash Cookies

Unread post by kev1n »

Hi,

Global Hash Cookies can currently be retrieved with nuGetProperty() and they can only be accessed server side and used in PHP, SQL.
You either have to resort to sessionStorage or write a PHP Procedure that retrieve global Hash Cookies and make them available in JavaScript.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Global Hash Cookies

Unread post by kev1n »

Update: The latest Github commit allows you to retrieve global Hash Cookies with nuGetProperty()
Post Reply