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.");
}
}
Is this work with on premise installation ?
ReplyDelete