Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Subform lookup filter
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Subform lookup filter
Hi,
Is there a way to use hach variables in a subform to filter a lookup? In the subform I need to select the "Warehouse" (first lookup) then a "zone" within the selected warehouse a then a "Zone Ref." from the selected zone.
Thank you.
Is there a way to use hach variables in a subform to filter a lookup? In the subform I need to select the "Warehouse" (first lookup) then a "zone" within the selected warehouse a then a "Zone Ref." from the selected zone.
Thank you.
BR
Rui
Rui
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
-
- Site Admin
- Posts: 2783
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 3 times
Re: Subform lookup filter
Rui,
You can filter lookups on fields from the main Form.
So if you put 2 hidden fields on the main Form and update them with the warehouse and zone from the same row anytime you "onfocus" zone or ref, zone and ref should filter out properly.
Here is a video on filtering a lookup..
http://www.youtube.com/watch?v=-XhDsNxVfDc
Steven
You can filter lookups on fields from the main Form.
So if you put 2 hidden fields on the main Form and update them with the warehouse and zone from the same row anytime you "onfocus" zone or ref, zone and ref should filter out properly.
Here is a video on filtering a lookup..
http://www.youtube.com/watch?v=-XhDsNxVfDc
Steven
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Subform lookup filter
Hi Steven,
Thank you for your reply.
I only have a problem:
The function to update the hidden fields is called from "onfocus" . If I clique on the button of the lookup form it does not work. It only works if I clique on the code area.
Any solution for this.
Thank you again for your support.
BR
Rui
Thank you for your reply.
I only have a problem:
The function to update the hidden fields is called from "onfocus" . If I clique on the button of the lookup form it does not work. It only works if I clique on the code area.
Any solution for this.
Thank you again for your support.
BR
Rui
BR
Rui
Rui
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
-
- Site Admin
- Posts: 2783
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 3 times
Re: Subform lookup filter
Rui,
Have you tried updating the 2 fields when you click into or hover over Zone and Ref?
Steven
Have you tried updating the 2 fields when you click into or hover over Zone and Ref?
Steven
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Subform lookup filter
Hi Steven,
I'm trying one field at the time.
I have the function:
But 'hidden_wh_id' is only updated when I click on the "code area". When I use the lookup button, it does not update the 'hidden_wh_id'.
Any suggestion?
Thank you.
I'm trying one field at the time.
I have the function:
Code: Select all
function whZone(){
document.getElementById('hidden_wh_id').value = document.getElementById(nuGetRow()+'good_wh').value;
idvalue = document.getElementById('hidden_wh_id').value;
}
Any suggestion?
Thank you.
BR
Rui
Rui
-
- Site Admin
- Posts: 2783
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 3 times
Re: Subform lookup filter
Rui,
Try something like this..
Obviously don't use jsi_product_id - or alert()
and do the same thing for every object you need to.
(jquery is pretty cool!)
http://www.w3schools.com/jquery/jquery_ ... ectors.asp
So is http://www.w3schools.com
Steven
Try something like this..
Code: Select all
$(document).ready(function () {
$("input[id$='jsi_product_id']").hover(
function () {
alert(this.id);
}
);
});
Obviously don't use jsi_product_id - or alert()
and do the same thing for every object you need to.
(jquery is pretty cool!)
http://www.w3schools.com/jquery/jquery_ ... ectors.asp
So is http://www.w3schools.com
Steven
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Subform lookup filter
Hi Steven,
Thank you.
I'm still facing one issue with the hash Variables in the subform. As you advised I have done the following:
- One the main form I have a hidden field "warehouse";
- Everytime I'm on focus in the Zone field (subform) it updates the "warehouse" field (Main Form) from the same row.
Until here everything is fine.
When I try to filter the lookup field in the subform using
it does not list anything.
But if I use
...it works.
This means if I use a field from the subform as has variable it works but if I use the hidden field from the main foprm it does not.
Could you please advise about this issue.
Thank you.
Thank you.
I'm still facing one issue with the hash Variables in the subform. As you advised I have done the following:
- One the main form I have a hidden field "warehouse";
- Everytime I'm on focus in the Zone field (subform) it updates the "warehouse" field (Main Form) from the same row.
Until here everything is fine.
When I try to filter the lookup field in the subform using
Code: Select all
SELECT FROM ....... WHERE wh_id='#wharehouse#'
it does not list anything.
But if I use
Code: Select all
SELECT FROM ....... WHERE wh_id='#subform_wh0000warehouse#'
...it works.
This means if I use a field from the subform as has variable it works but if I use the hidden field from the main foprm it does not.
Could you please advise about this issue.
Thank you.
BR
Rui
Rui
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Subform lookup filter
Hi Steven,
Any idea why the hidden field "warehouse" does not work as hash variable?
Thanks
Any idea why the hidden field "warehouse" does not work as hash variable?
Thanks
BR
Rui
Rui