How to use link lookup in Grid Control?

Posted by matman on 05-Dec-2014 09:42

I have created a link lookup for one of my complex objects. When I visit the "New" page, the link lookup seems to work fine and update when I change the related field. But when I put them both in a grid, it stops working. Is there any way quick way I could get it to work?

Posted by Orchid Corpin on 05-Dec-2014 10:30

Hi,

Dependent lookup seems to be not working on grid control but I have alternative way to make it work by using "rbf_setLookupFilter".

1. Go to Configure grid and set the onUpdate with your function in my sample is filterLookup(@@);

2. Save. Apply rbf_setLookupFilter in the script component with sample code below. Change the following codes:

R111029 --> Parent lookup (Warehouse) in grid, inspect element to get the integration name.
R130928 --> Dependent lookup (Product) in grid, inspect element the lookup to view integration name. See image
R56036 -- > This is an integration name of parent (warehouse) from Product Object. In my test, go to Product object definition and get the value of warehouse lookup integration name.

<script>
function filterLookup(rowIndex) {
	var parentId = rbf_getGridValue2(0, "R111029", rowIndex);
	console.log(parentId);
	rbf_setLookupFilter("R130928_0_"+rowIndex, "R56036", parentId);
}
</script>


Hope this may help.

Regards,
Orchid

All Replies

Posted by Orchid Corpin on 05-Dec-2014 10:30

Hi,

Dependent lookup seems to be not working on grid control but I have alternative way to make it work by using "rbf_setLookupFilter".

1. Go to Configure grid and set the onUpdate with your function in my sample is filterLookup(@@);

2. Save. Apply rbf_setLookupFilter in the script component with sample code below. Change the following codes:

R111029 --> Parent lookup (Warehouse) in grid, inspect element to get the integration name.
R130928 --> Dependent lookup (Product) in grid, inspect element the lookup to view integration name. See image
R56036 -- > This is an integration name of parent (warehouse) from Product Object. In my test, go to Product object definition and get the value of warehouse lookup integration name.

<script>
function filterLookup(rowIndex) {
	var parentId = rbf_getGridValue2(0, "R111029", rowIndex);
	console.log(parentId);
	rbf_setLookupFilter("R130928_0_"+rowIndex, "R56036", parentId);
}
</script>


Hope this may help.

Regards,
Orchid

Posted by Orchid Corpin on 10-Dec-2014 10:29

Hi Matman,

Does the suggestion above works for you? Or do you still have followup questions regarding to this?
Thank you.

Regards,
Orchid

Posted by matman on 11-Dec-2014 02:44

Hey Orchid, sorry I forgot to thank you for that awesome explaination. Works like a charm! :)

Posted by Orchid Corpin on 11-Dec-2014 11:40

That's Great! You're welcome. :)

Regards,

Orchid

This thread is closed