Conditional Select

I have typical Invoice App. It works fine but now I need a new feature.

  1. Invoice is open and saved (so customer can add ITEMS)
    2, I use EditableGridView App for details. When user clicks ADD button (actually it is an icon) the record opens for editing (insetion)
  2. I have an icon next to the item SKU which (when clicked) allows to select an item from the modal window which pops up (simple grid with SELECT button)

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“title”:“2019-01-28 14_12_43-dPS TIME MANAGER.jpg”,“data-attachmentid”:86324}[/ATTACH]

MODIFICATION NEEDED
Upon clicking lookup icon I need to be able to select from LIST-A or LIST-B. Those two lists will show items from twqo different tables (i.e. TableA and TableB)
after the list is show everything else will remain the same. I do not see any embed point or Ajax event that I could test for my condition to show either List-A OR List-B.

Any ideas how to do it ?

2019-01-28 14_12_43-dPS TIME MANAGER.jpg