I am trying to save(Archive) an Electronic Report(ER) for SalesInvoice on a diferent location as Archived by default. What I did so far is what described under this article: Implement a custom destination for generated documents - Finance & Operations | Dynamics 365 | Microsoft Learn but my problem is that I want for example, when I trigger the 'Use print management' button to generate the ER, store also this report reference at attachment of the selected record as below.
What i found out is that there is a method under ERDocuManagement class wich called attachFile which is private. On this method I realise that there are two points that should be changed: ret.RefTableId = DocuRef::GetRootTableID(_owner.TableId); and ret.RefRecId = _owner.RecId; which I guess is what I need to change. My problem is that I do not know if I am on the right direction with a possible solution of my issue.
I appreciate any help and support. I am new on D365 FO and there many gaps of knowledge.
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.