Hi!
I'm doing a fetch(JavaScript XrmSvcToolkit.fetch) from ActivityParty and the attribute partyobjecttypecode is missing from the result...
var entityId = Xrm.Page.data.entity.getId();
var activitypartyFetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'> "
+ "<entity name='activityparty'> "
+ "<filter type='and'> "
+ "<condition attribute='ispartydeleted' operator='eq' value='0' />"
+ "<condition attribute='activityid' operator='eq' value='" + entityId + "'/>"
+ "<condition attribute='partyobjecttypecode' operator='in'><value>1</value><value>2</value></condition>"
+ "</filter> "
+ "</entity> "
+ "</fetch>";
XrmSvcToolkit.fetch({
fetchXml: activitypartyFetchXml,
async: false,
successCallback: function (result) {
},
errorCallback: function (error) {
alert("Getting activityparty failed: " + error.description);
}
});
The result is:
<resultset morerecords="0" paging-cookie="<cookie page="1"><activitypartyid last="{A5E6D853-0517-E411-B960-0050563001C5}" first="{A5E6D853-0517-E411-B960-0050563001C5}" /></cookie>">
<result>
<donotemail name="Allow">0</donotemail>
<partyid dsc="" type="1" name="The TestAccount Company">{7978B6CD-EBF5-E311-AC24-0050563001C5}</partyid>
<activityid type="4200">{A3E6D853-0517-E411-B960-0050563001C5}</activityid>
<donotfax name="Allow">0</donotfax>
<activitypartyid>{A5E6D853-0517-E411-B960-0050563001C5}</activitypartyid>
<donotpostalmail name="Allow">0</donotpostalmail>
<participationtypemask name="To Recipient" formattedvalue="2">2</participationtypemask>
<ispartydeleted name="No">0</ispartydeleted>
<ownerid type="8">{E76A4FB6-45DF-E311-AC24-0050563001C5}</ownerid>
<instancetypecode name="Not Recurring" formattedvalue="0">0</instancetypecode>
<donotphone name="Allow">0</donotphone>
</result>
</resultset>
I can read the id and name but
not the type of "partyid".
result.entities[0].partyid.Id --> OK
result.entities[0].partyid.Name --> OK
result.entities[0].partyid.Type --> NOT OK
Why is partyobjecttypecode missing in the result and how is it possible to read the "type" from the partyid node?
Br Knut