Search code examples
typescriptdynamics-crmxrmxrmquery

Get formatted value from webattribute with typescript xrmquery


I have a xrmquery in typescript:

enter image description here

cgk_employerid_guid is like this:

enter image description here

I need to get the cgk_employerid_formatted value. But when the query runs it gives cgk_employerid_guid as a string, so it's not possible to get the formatted value from it.

Does anyone knows the solution to get the formatted value with the select of the query?

thx in advance.


Solution

  • During a retrieve multiple call in XrmQuery, you can also apply includeFormattedValues() on the query, just before executing it.

    This will include the formatted values of the retrieved attributes in the result.