I think I may know what the problem is. When an activity is opened from the ActivityTab control (which all the main work item forms use, SR, Incident, etc), the ActivityTab "Fetches and Merges" a separate type projection into the main form's data
context.
The type projection it uses happens to be: System.WorkItem.WorkItemActivities.Projection (id 4A66EE5A-5EBC-1C0E-362A-BA6BBDB8C7FE)
That type projection does include some of the components that the RelatedItems tab can expose..however, if the component aliases do not match, the related items tab won't have any components to display.
So, for example, I took a quick look at your code and it looks like you're using "RelatedWorkItems" as the related work items component alias. The type projection used by the ActivityTab has a "RelatedWorkItem" component alias.
Try changing the component aliases that you use to match those component aliases that already exist in the System.WorkItem.WorkItemActivities.Projection.
From a quick look at your code and the ActivityTab's type projection, give this a try first:
RelatedWorkItems -> RelatedWorkItem
RelatedWorkItemsSource -> RelatedWorkItemSource
RelatedConfigItems -> RelatedConfigItem
LinkedKnowledgeArticles -> RelatedKnowledge
FileAttachments -> FileAttachment
I can't guarantee this'll work as I haven't actually tried it myself..but I've had to deal with those ActivityTab type projection aliases in the past, and making sure they match always cleared things up for me.
In your manual activity form type projection, use the same aliases (and the same component paths, if you can) that the System.WorkItem.WorkItemActivities.Projection uses. Modify your code where you instantiate the related item tab to use those new component
aliases. The related items tab should then work for both the activity form and parent work item sub forms.
Give it a whirl and let me know if it worked for you. If not, we'll start looking at some custom FetchAndMergeSubPrjoection approaches.
-
Proposed as answer by
Thomas Bianco
Thursday, May 21, 2015 7:02 PM
-
Marked as answer by
Marat Kuanyshev
Friday, May 22, 2015 12:17 AM