Forum Post: RE: How can i display only related records in the lookup

  • Thread starter Thread starter Orchid Corpin
  • Start date Start date
Status
Not open for further replies.
O

Orchid Corpin

Guest
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

Continue reading...
 
Status
Not open for further replies.
Back
Top