Updating lookup picklist with "Advanced display options"

Updating lookup picklist with "Advanced display options"

Hi!


In a form ("SampleForm") I set lookup field "Client": [Appname] - ClientsBase [Form name] - ID [Field name]
with Display as: (Advanced display options) "ClientName"

In the same "SampleForm" I also set another picklist field "ClientType".


My target is: When I pick "ClientType" I'd like to see in "Client" piclist Names of those clients only of choosen Type.

I've tried:
"ClientType" - on user input:

  1. clear Client;
  2. client_var  =  ClientsBase  [Type == input.ClientType];
  3. Client:ui.add(client_var.ClientName.getAll());
It works only partially. In "Client" I can see clients only of choosen Type, but I see "ID" field instead of "ClientName" (as I set in "Advanced display options").


Help, please.
Leszek