Display list value in UDEF field in Sales on ticket in Service

Is it possible to display a UDEF field (mapped to a list) on the company card in Sales on a ticket in Service?

RE: Display list value in UDEF field in Sales on ticket in Service

Hi Patrik, no it is not, unless the bug has been fixed.

You can display the ID of the list item, but not the value.

 

Previously I've created a textfield on the contact which I have updated from a trigger.

Av: Simen Mostuen Iversen 7. jun 2019

RE: Display list value in UDEF field in Sales on ticket in Service

So you have a list and a trigger takes the wanted value and copies it to a text field for this purpose?

Av: Patrik Larsson 7. jun 2019

RE: Display list value in UDEF field in Sales on ticket in Service

Yes - basically you have a trigger that listens to the "After save" function, and grabs the value after each save and just do an update on the x_field.

If you need a specified code for this, I can make you one :)

Av: Simen Mostuen Iversen 7. jun 2019

RE: Display list value in UDEF field in Sales on ticket in Service

So it has to be scripted?

If you have an example code, I would gladly receive a copy :)

Av: Patrik Larsson 7. jun 2019

RE: Display list value in UDEF field in Sales on ticket in Service

Create a trigger on "After saving company"

 

Something like this:

EventData ed = getEventData();

String contactId = ed.getInputValue("ContactEntity.ContactId");
String listValue = ed.getInputValue("ContactEntity.UserDefinedFields.SuperOffice:1:DisplayText");

SearchEngine se;
se.bypassNetServer(true);
se.addData("contact.x_field", listValue.parseSOMultiLanguageString(-1));
se.addCriteria("contact.contact_id", "Equals", contactId);
se.update();

Where SuperOffice:1 is the ProgId for the field and x_field is the extra field in Service

 

Av: Simen Mostuen Iversen 7. jun 2019

RE: Display list value in UDEF field in Sales on ticket in Service

Many thanks!

Av: Patrik Larsson 7. jun 2019