I have an invoice form. There is a lookup for the customer, and a lookup for the customer's vehicle. One customer may have many vehicles. I have used nuSetProperty with an onclick event that passes a hash cookie to the lookup form and filters using a WHERE statement. I can make it work by manually putting in the actual customer_id record but I cannot get the syntax right to pull the customer_id record from the database. It seems this method only works for a fixed value and not a relational value?
Craig
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Filter Records for a Lookup
-
- Posts: 42
- Joined: Sat Jul 18, 2015 8:04 pm
- Has thanked: 3 times
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Filter Records for a Lookup
Hi Craig
Use the onfocus event instead of onclick event to set the Hash Cookie.
Use the onfocus event instead of onclick event to set the Hash Cookie.
-
- Posts: 42
- Joined: Sat Jul 18, 2015 8:04 pm
- Has thanked: 3 times
Re: Filter Records for a Lookup
Kevin,
I'm sorry to bother you with this. I must be thick...
This is what I am putting on the vehicle lookup object custom code (or should this be on the customer lookup?) This is what shows up in the form info but only after I click on the text box for the lookup object. Clicking the magnifying glass on the object doesn't change it. This is the code in the lookup browse form Thanks
Craig
I'm sorry to bother you with this. I must be thick...
This is what I am putting on the vehicle lookup object custom code (or should this be on the customer lookup?) This is what shows up in the form info but only after I click on the text box for the lookup object. Clicking the magnifying glass on the object doesn't change it. This is the code in the lookup browse form Thanks
Craig
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
-
- Posts: 42
- Joined: Sat Jul 18, 2015 8:04 pm
- Has thanked: 3 times
Re: Filter Records for a Lookup
I have tried the customer lookup before And just tried it again. Didn't work. I would expect it would pass the actual PK for the customer but the form info>--properties shows it setting the property to "customer_id" not the PK for that particular customer. Is this the normal behavior, and is this the proper way to accomplish filtering the lookup?
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Filter Records for a Lookup
By setting nuSetProperty('customer', 'customer_id'), the string customer_id is set as Hash Cookie and not the actual value.
Is customer_id a field on your form? then try nuSetProperty('customer', customer_id.vaue) instead
Is customer_id a field on your form? then try nuSetProperty('customer', customer_id.vaue) instead