How can I get a complete list of transactions on my Dynamics CRM account?
Using CRM views, is there a way to get a list of all the activities associated with a specific account?
I want it to retrieve not only those related to the account directly, but also those related to the account contacts, cases, etc. I am trying to replicate the list generated when you click the Actions option from an account.
So far I have found the contacts for the account and their actions. I also noticed that CRM doesn't seem to always return what I expect. Occasionally, the activity associated with the account contacts is not displayed. In other cases, messages / appointments are displayed that are logically associated with the account, but have nothing in the aboutobjectid field.
I hope this does not mean creating the mother of all associations or requesting each activity in isolation. In particular, because I need all the related cases, opportunities, etc.
source to share
I used something like this. In fact, I create a var table with all the outlines of the items I want to look for (in my accounts and contacts), then I query the AcitivtyParty for all the activities where they are members of that activity, then go to the Activity to get the details.
Declare @account_guid varchar(200)
Select @account_guid = 'insert some guid here'
Declare @GUIDS as Table(id varchar(200), fullname varchar(200), objecttype char(2))
Declare @ActivityIds as Table(id varchar(200))
--grab all guids we need activities for
Insert Into @GUIDS
Select contactid, fullname, 'C'
From FilteredContact
Where accountid = @account_guid
UNION ALL
Select accountid, [name], 'A'
From FilteredAccount
Where accountid = @account_guid
--find all activities where the account/contact are referred to
Insert Into @ActivityIds
Select activityid
From FilteredActivityParty fap
Join @GUIDS g on g.id=fap.partyid
Group By activityid
Select *
From FilteredActivityPointer fap
Join @ActivityIds a on fap.activityid = a.id
Where statecode<>2 --hide canceled items
source to share
To accomplish your task, you must use the Rollup request (if you are working with the SDK web service):
The Microsoft Dynamics CRM Rollup Action has a powerful Rollup message that allows you to open an instance object, such as an account, and find information not only about the associated account (opportunities, quotes, orders, invoices, contracts and cases), but also and about accounts and contact accounts.
more:
TargetRollupActivityPointerByAccount Class (CrmService) Specifies the parameters required to retrieve all activities associated with the specified account.
source to share
check the post below, it uses the retrieve plugin for fold operations for a custom entity that is not supported by embedded CRM: http://www.catapulterp.com/blog/2013/03/11/rolling-up-custom-entities-in-microsoftcrm -2011-and-crm-online /
source to share