Advanced reference qualifier with value in form

Bart15
Giga Contributor

I have a question regarding an advanced reference qualifier I'm trying to configure.

Situation:

On the company form I have a reference field called 'contact' that references to the 'customer_contact' table.
On that table there are users and there is a field called ' account' which refers to their company.

I want the field 'contact' on the company form to only show contacts that have the same account as the current company.

So 'account' on the 'customer'contact' table has to be the same as 'name' on the core_company table.

I've tried something like:

javascript: 'account = '+current.name;

(with and without the attribute ref_qual_elements= name)

and 
account=javascript: current.getValue('name')^EQ
but I cannot get it to work.

How can I achieve this?

1 ACCEPTED SOLUTION

Can you try

javascript: 'account='+current.sys_id;

 

View solution in original post

4 REPLIES 4

Michael Fry1
Kilo Patron

Is account a custom field? so u_account which would make this:

javascript: 'u_account = '+current.name;

 

No it's not a custom field.

Perhaps it has something the do with that the customer_contact table is in a different scope? (it's in the customer service scope)


I've tried to change the reference to table sys_user and use the company field on that table:

javascript: 'company = '+current.name; 

but that doesn't work neither.

What am I missing?



 

Can you try

javascript: 'account='+current.sys_id;

 

Bart15
Giga Contributor

That did the trick. Never tough of using the sys_id. Thank you very much.