How can i display only related records in the lookup

Posted by Sudhakar on 22-Jul-2014 11:16

Hi all,

when i click on look up then it will open new window for selecting documents,but it is not displaying any documents in the new window,if i assign a view to that selector then it is displaying all the documents in the system.

my  question is how can i display only documents related to that client while opening the new window for selecting documents(OnLoad).








Posted by Orchid Corpin on 23-Jul-2014 14:27

Hi SudhakarN,

Does this answer your question? or is there anything we can help you?

Regards,
Orchid

All Replies

Posted by Orchid Corpin on 22-Jul-2014 12:58

Hi SudhakarN,

You can use the rbf_setLookupFilter API for this.

First: Configure your grid, you can click on the gear icon beside your "Shipping Information" section label.
Click Next button > and in the bottom part set your function, something like "setGridFilter(@@);" (this is the function in the script below) to call it every create of new grid row. See image below.

Second: In your NEW or EDIT page create a new <Script Component> and paste the code below (just change the integration names with your fields).

<script>
function setGridFilter(gridIndex) {
//Get the ID/value of the parent to be use in the filter
var parentFilter = rbf_getFieldValue("R105266983");
//Grid Number - Note: 1st Grid is equal to 0, 2nd grid is 1 and so on...
var gridNumber = 0;
//Lookup field in the grid that you want to filter by its parent
var childField = "R105203172_"+gridNumber+"_"+gridIndex;
//This is same object as the 'parentFilter' above but this time the relationship of parent and child
//In your case go to object defination of 'Attachment' and get the integration name of 'Client' lookup
var parentField = "R105203549";
//RB API to set lookup filter
rbf_setLookupFilter(childField, parentField, parentFilter);
}
</script>

Hope this will help.

Regards,

Orchid

Posted by Orchid Corpin on 22-Jul-2014 13:01

rbf_setLookupFilter will not set the value in the UI filter but filter through code.

Posted by Sudhakar on 23-Jul-2014 14:15

thanks for your reply [mention:e6fb884e9c7b45a2a638966c06dc0941:e9ed411860ed4f2ba0265705b8793d05]

Posted by Orchid Corpin on 23-Jul-2014 14:27

Hi SudhakarN,

Does this answer your question? or is there anything we can help you?

Regards,
Orchid

This thread is closed