Soap.Fetch results

Jul 15, 2013 at 2:31 PM
Here are part of the results when I run the FetchXml in the Stunnware tool:
    <tpm_availablestatus name="Approved" formattedvalue="928200009">928200009</tpm_availablestatus>
When I run Soap.Fetch this is how I retrieve the value: result[0].attributes["tpm_availablestatus"].value
This returns "928200009" which is good.

I now need the value "Approved" as shown in the results so I try: result[0].attributes["tpm_availablestatus"].name
This gives me an error of "undefined". How do I retrieve the "Approved" value in the results?
Jul 31, 2013 at 10:11 AM
Hi There.

In current stage, the deserialization process only gets the value not attributes.

The options are:
  1. you can modify the deserialization function if this is absolutely required.
  2. normally the values are the only meaningful results we care. "Approved" in your example may simply be put as a constant in a separate JavaScript file. ( I normally have a separate class to define things like form types, onSave event types, etc
Hope this helps,
May 11, 2014 at 10:11 PM
I cannot speak for prior version, but, I'm using the latest version 2.0.1, for CRM 2013, and the 'formattedValue' property returns the option set's display value.