D365 finops send attachment as public URL X++ A customer needs to download attachments from a mobile application that is connected to Dynamics 365 Finance and Operations (FinOps). I have created the following function in the Service to generate a public URL for the attachments. public str getPublicUrl(RecId _recid) { DocuRef _ref; select _ref where _ref.RecId == _recid && _ref.RefTableId == tableNum(PurchTable); if (_ref.RecId) { return File::SendFileToTempStore( DocumentManagement::getAttachmentStream(_ref), ERDocuRef_Extension::filename(_ref), classstr(FileUploadTemporaryStorageStrategy), true ); } else { throw error("Attachment not found for the provided RecId."); } }
I had a scenario where I had to call a new method in one of the fields from Vendor Payment Journal Line. The new method exists in Extension class of Vendor Payment journal.(which is a form method). This has to be called in modified method of the field ‘Ledger Dimension’. The steps are as follows [ExtensionOf(FormStr(LedgerJournalTransVendPaym))] final class LedgerJournalTransVendPaymFormExt_Extension { public void newMethod() { ………………. } } How do call this method in modified ? you have two choices – Create a event handler for the method or Chain of Commands. On using event handler, I ended up with error when I tried to call the new method using formRun. [FormDataFieldEventHandler(formDataFieldStr(LedgerJournalTransVendPaym, LedgerJournalTrans, LedgerDimension), FormDataFieldEventType::Modified)] public static void LedgerDimension_OnModified(FormDataObject sender, FormDataFieldEventArgs e) { FormDataSource ledgerJournalTrans_ds = sender.datasource(); FormRun