Answered by:
Retrieve Company name from the Post in contact Entity - MS CRM 2013 online

Question
-
Hi All,
We have a feature in the contact entity, on change of a field called call status we are triggering a workflow which will take the current value of the call status field and creates a new status in the Auto Post. So repeated calling and call status by Target marketing will be captured.
Below is the Sample
Now the issue i am facing is creating a report out of it to capture # of calls and call status.
This is the sample report I've created. I am not able to Display the Account name in this report.
Fetch XML used:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="post">
<attribute name="postid" />
<attribute name="createdon" />
<attribute name="createdby" />
<attribute name="source" />
<attribute name="modifiedon" />
<attribute name="text" />
<attribute name="regardingobjectid" />
<attribute name="createdonbehalfby" />
</entity>
</fetch>Kindly suggest how this can be done.
Regards, Rekha.J
Thursday, February 26, 2015 5:15 AM
Answers
-
Try This?
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" > <entity name="post" > <attribute name="postid" /> <attribute name="createdon" /> <attribute name="createdby" /> <attribute name="source" /> <attribute name="modifiedon" /> <attribute name="text" /> <attribute name="regardingobjectid" /> <attribute name="createdonbehalfby" /> <link-entity name="contact" from="contactid" to="regardingobjectid" alias="ae"> <link-entity name="account" from="primarycontactid" to="contactid" alias="af"> <attribute name="name" /> </link-entity> </link-entity> </entity> </fetch>
- Marked as answer by Rekha J Thursday, February 26, 2015 8:47 AM
Thursday, February 26, 2015 6:22 AM
All replies
-
Try This?
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" > <entity name="post" > <attribute name="postid" /> <attribute name="createdon" /> <attribute name="createdby" /> <attribute name="source" /> <attribute name="modifiedon" /> <attribute name="text" /> <attribute name="regardingobjectid" /> <attribute name="createdonbehalfby" /> <link-entity name="contact" from="contactid" to="regardingobjectid" alias="ae"> <link-entity name="account" from="primarycontactid" to="contactid" alias="af"> <attribute name="name" /> </link-entity> </link-entity> </entity> </fetch>
- Marked as answer by Rekha J Thursday, February 26, 2015 8:47 AM
Thursday, February 26, 2015 6:22 AM -
Hi Jithesh,
Thanks for the reply.
The above code retrieves no data and so no output is displayed, not even a single record is retrieved.
I previously had tried something similar to this , which retrieved the records but account name it was displaying some wrong data.
Below is that code which I tried.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="post">
<attribute name="postid" />
<attribute name="createdon" />
<attribute name="createdby" />
<attribute name="source" />
<attribute name="modifiedon" />
<attribute name="createdonbehalfby" />
<attribute name="regardingobjectid" />
<attribute name="text" />
<link-entity name="systemuser" from="systemuserid" to="createdby" alias="ak">
<link-entity name="account" from="createdby" to="systemuserid" alias="al">
<attribute name="name" />
<filter type="and">
<condition attribute="name" operator="not-null" />
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
Regards, Rekha.J
- Edited by Rekha J Thursday, February 26, 2015 6:35 AM
Thursday, February 26, 2015 6:34 AM -
Hi,
The fetchxml mentioned should work if you are using the out of the box relationship.
To find the correct relationship in your organisation, create an advanced find - from contact to Account, export the fetchxml and see what link is used in your system to link from Contact to account.
The only change would be on the line
<link-entity name="account" from="primarycontactid" to="contactid" alias="af">
Regards,
Jithesh
Thursday, February 26, 2015 6:42 AM -
Hi,
Yes you are right. Thank you:)
Regards, Rekha.J
Thursday, February 26, 2015 8:47 AM