Welcome to the nuBuilder Forums!

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

Subform row id - hash cookie

Questions related to using nuBuilder Forte.
Locked
tovidiu
Posts: 17
Joined: Sat Jan 06, 2018 5:45 pm

Subform row id - hash cookie

Unread post by tovidiu »

I'm trying to create a button that opens the record from another table to be edited but I can not do it because I do not know the record_id of the row from the subform to insert it into the filter field.
The field "Nr Top" holds the id field of "Parcele extravilan" form, i put the id field in the browse of "Parcele extravilan"

What am I doing wrong?
THX
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform row id - hash cookie

Unread post by admin »

tovidiu,

Great question.

Instead of using a Run Object, use an Input Object and set its Type to Button (they should still look the same).

Add an onclick Event via its Custom Code Tab with the following Javascript.

Code: Select all

nuPopup('aaaa', nuSubformRowId(this));           //-- make aaaa the id of the Form you would like to open
Here is some help in the wiki ...

http://wiki.nubuilder.net/nubuilderfort ... ab_-_Input

http://wiki.nubuilder.net/nubuilderfort ... pt#nuPopup

http://wiki.nubuilder.net/nubuilderfort ... bformRowId


Steven
tovidiu
Posts: 17
Joined: Sat Jan 06, 2018 5:45 pm

Re: Subform row id - hash cookie

Unread post by tovidiu »

Thanks for the reply,
I did as you said but it does not work, nothing happens when I click on the button.
this is the code

Code: Select all

nuPopup('5a29ddbd60e1aa9', nuSubformRowId(this));
I modified the code according to the parameters "noPopup (string1, string2, string3)" as follows

Code: Select all

nuPopup('5a29ddbd60e1aa9', '', nuSubformRowId(this));
but it still does not work.

in this version should open the form '5a29ddbd60e1aa9' as browse with filter nuSubformRowId(this), but stil nothing happens. As if it did not read the row id of the subform.


it is possible to use the following code? I want to use the lookup field not the subform row id, because like this it will open up directly in Edit form

Code: Select all

nuPopup('5a29ddbd60e1aa9','lookup_field');
Ovidiu
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform row id - hash cookie

Unread post by admin »

Ovidiu,

You will need the lastest from github because I just added nuSubformRowId().

If you want the value from a Lookup or other Object try...

Code: Select all

nuSubformValue(this, 'ite_product_id');

Steven
tovidiu
Posts: 17
Joined: Sat Jan 06, 2018 5:45 pm

Re: Subform row id - hash cookie

Unread post by tovidiu »

It works perfectly!

Thank you very much Steven!

Ovidiu
tovidiu
Posts: 17
Joined: Sat Jan 06, 2018 5:45 pm

Re: Subform row id - hash cookie

Unread post by tovidiu »

And if I have the same case but the lookup object and the button are in form not subform, how can i read the lookup value to use it in Javascript?

for example:

Code: Select all

nuPopup('5a29ddbd60e1aa9', nuFormValue(this, 'lookup_field'));
Ovidiu
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform row id - hash cookie

Unread post by admin »

Ovidiu,

If your Object is on an Edit Form, you can get the value this way...

Code: Select all

var v = $('#lookup_field_id').val();               //-- the Object's ID prefixed by a #
Here are other ways you can use this $() jQuery function... https://www.w3schools.com/jquery/jquery ... ectors.asp

Steven
tovidiu
Posts: 17
Joined: Sat Jan 06, 2018 5:45 pm

Re: Subform row id - hash cookie

Unread post by tovidiu »

Thank you, it works!!

Ovidiu
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform row id - hash cookie

Unread post by admin »

.
Locked