Reference field on a custom table

Southsayer
Tera Expert

Hello guesss,

I'm creating a reference field on a custom table and this field will populate dynamic data depending on another field value.

I'm trying to achieve this and I'm also getting dynamic dropdown values 

However, I'm getting duplicates

I only want unique records.

How can I achieve this?

 

It's really simple to do on catalog variables since we have lookup select box but do we have just type on forms?

How can I removed duplicate values? 

7 REPLIES 7

Nilesh Pol
Tera Guru

If your target table (e.g., u_budget_expense) contains multiple rows with the same value in the column you're referencing (e.g., project_code), then even though you're filtering correctly, the dropdown still shows multiple rows because each row is a separate record (with a different sys_id).

 

You can create a database view or a custom table that contains only distinct values.

  1. Create a table (or view) with just unique project codes.

  2. Populate it using a scheduled job or script that extracts unique values.

  3. Point your reference field to that table instead.

This is clean and performant.

How can I achieve this Nitesh?

You can create a database view or a custom table that contains only distinct values.

  1. Create a table (or view) with just unique project codes.

  2. Populate it using a scheduled job or script that extracts unique values.

  3. Point your reference field to that table instead.

Bert_c1
Kilo Patron

Based on your first sentence...Look at the definitions for 'assigned_to' and 'assignment_group' for task table. Once the assignment_group is filled in, the choices for assigned_to are limited the the specific group chosen.

 

field-administration MakingAFieldDependent

 

More details on what you have done are needed, for a form field, you can use a client script and script include (logic here can avoid duplicates).

Hi Bert, 

Please provide me with the logic that you were talking about