Tuesday, November 14, 2017

Dynamics 365 - How to open standard AX Attachments dialog with a different caller or source record

Standard AX Attachments dialog always looks for the caller form's primary data source and displays all the attachments related to this (if available). 

But my requirement is to link a form which has a view or a table as a non-primary data source and  open the Attachments dialog for it.

We can achieve this by doing 1, 2 and 3


1: If the table/view is not added yet as datasource, then add it to the form as a data source and join it with the primary datasource, if it is not the primary itself.

2: Set the OnlyFetchActive property of this data source to Yes so that it only fetches recIds from the database hence minimizes the impact on performance. 


3: Override the docCursor() method of the form and return the table/view buffer.


Thats it!!

No comments:

Post a Comment