{"id":180,"date":"2009-09-23T12:38:00","date_gmt":"2009-09-23T07:08:00","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=180"},"modified":"2009-09-23T12:38:00","modified_gmt":"2009-09-23T07:08:00","slug":"how-to-design-a-custom-activitieshistory-tab-to-show-activity-party-information","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2009\/09\/how-to-design-a-custom-activitieshistory-tab-to-show-activity-party-information\/","title":{"rendered":"How to design a Custom Activities\/History tab to show Activity Party information"},"content":{"rendered":"<p><span>There have often been requests for displaying the Activity Parties in the Activities\/History tab of Account\/Contact.<\/p>\n<p>The details in these views are gathered from the ActivityPointer entity. The activity pointer entity is not customizable and so you are stuck with not having the activity party information like Sender\/Receiver not being available for reference in the views.<\/p>\n<p>However it is not that difficult to get a custom page to develop that does just this.<\/p>\n<p>Let\u2019s look at the various aspects related to this.<\/p>\n<p>1.       The Activities\/History tab display not only activities directly associated with the account but also related entities of account.<\/p>\n<p>How do we get this? The answer lies in the \u201cTargetRollupActivityPointer\u201d messages available in the SDK.<\/p>\n<p>There are three different variation of this message available<\/p>\n<p>\u00b7         TargetRollupActivityPointerByAccount<br \/>\u00b7         TargetRollupActivityPointerByContact<br \/>\u00b7         TargetRollupActivityPointerByOpportunity <\/p>\n<p>Searching the SDK for these messages should help you get you going with these messages.<\/p>\n<p>\/\/ Create the target for the request.<br \/>TargetRollupActivityPointerByAccount target = new TargetRollupActivityPointerByAccount();<br \/>target.AccountId = new Guid(&#8220;A0F87168-4B00-4CA2-925D-AA0A4C47B86F&#8221;);<\/p>\n<p>2.       Get the Activity Parties Associated with these activities.<\/p>\n<p>The information regarding the parties involved in an activity is not stored along with the activity but rather in a separate entity called activityparty.<\/p>\n<p>You can query for activity party and search for activityid = activitypointer.activityid.<\/p>\n<p>Note the result will return more than one records. This entity stores not just the sender\/receiver but also the owner and organizer and such other activity party information. The participation type mask attribute describes the role of this party in the activity (search for activitypartytype in SDK for the entire list).<br \/><\/span><br \/><span>\/\/ Create the ConditionExpression. <\/span><br \/><span>ConditionExpression condition = new ConditionExpression();<\/span><br \/><span><\/span><br \/><span>\/\/ Set the ConditionExpressions Properties so that the condition is true <\/span><br \/><span>condition.AttributeName = &#8220;activityid&#8221;;<\/span><br \/><span>condition.Operator = ConditionOperator.Equal<\/span><br \/><span>condition.Values = new string [] {activityid.ToString()};<\/span><br \/><span><\/span><br \/><span>\/\/ Set the properties of the QueryExpression<\/span><br \/><span>query.EntityName = EntityName.activityparty.ToString<\/span><br \/><span>query.ColumnSet = new AllColumns();<\/p>\n<p>3.       If you want to go further and be ambitious enough to add a column for displaying an attachment flag in case of emails with attachment.<\/p>\n<p>CRM store the Email attachment information in the &#8220;activitymimeattachment&#8221; entity. You can filter this entity and look for activityid = activitypointer.activityid. If it returns any row it has attachments associated with it and you can add \u201ctrue\u201d flag for this.<\/span><br \/><span><\/span><br \/><span>\/\/ Create the ConditionExpression<\/span><br \/><span>ConditionExpression condition = new ConditionExpression<\/span><br \/><span><\/span><br \/><span>\/\/ Set the ConditionExpressions Properties so that the condition is true <\/span><br \/><span>condition.AttributeName = &#8220;activityid<\/span><br \/><span>condition.Operator = ConditionOperator.Equal<\/span><br \/><span>condition.Values = new string [] {emailId.ToString()};<\/span><br \/><span><\/span><br \/><span>\/\/ Set the properties of the QueryExpression<\/span><br \/><span>query .EntityName = EntityName. activitymimeattachment.ToString();                        query.ColumnSet = new AllColumns();<\/p>\n<p>Following the 3 \u2013 steps explained above you can get your custom page working the way you want.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There have often been requests for displaying the Activity Parties in the Activities\/History tab of Account\/Contact. The details in these views are gathered from the ActivityPointer entity. The activity pointer entity is not customizable and so you are stuck with not having the activity party information like Sender\/Receiver not being available for reference in the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2009\/09\/how-to-design-a-custom-activitieshistory-tab-to-show-activity-party-information\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[19],"tags":[93,442],"class_list":["post-180","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm","tag-activity-party","tag-custom-activitieshistory-tab"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}