Hello community.
i am trying to Export a PDF attachment from D365.
Our client would like to provide their vendors a file download link from their portal (not a D365 session).
For information, our storage local is set to Azure Blob.
We tried two approaches and both failed:
Via OData:
we built a new Entity with DocuRefEntity as primary DataSource and added my table as secondary (for Record Identity purpose).
The problem is the field DocuRefEntity.Attachment always returns "null".
Maybe because of the following standard code:
DocuRefEntity.defineFileContents()
private static str defineFileContents()
{
// This is a workaround to get import/export working since it does not recognize a virtual container field.
return SysComputedColumn::nullExpression();
}
Via Custom Service (API):
we built a Class that receives Record Identity and retrieves the following Download URL:
docuURL = "filemanagement/bc36fd9f-8d45-4b01-83af-6f3f9446c3a5?access_token=eyJDb21wYW55IjoiMSIsIkhhc2hlZFRva2VuIjoiYmRVVHZTR1VINU1rSERVNWlaNGVUbDRtY0xMQnVhVnpOT0o2eHNhVGVJaW1NdlpqNlNERGxNTTFpeW1UMU9SWXkxeEhlaHNCcXVWb052VStZclwvRWZ3PT0iLCJQYXJ0aXRpb24iOjU2MzcxNDQ1NzYsIlVzZXJJZCI6NTYzNzE0NDU3NiwiVmFsaWRVbnRpbCI6IlwvRGF0ZSgxNjM2MDUxMjk3NTExKVwvIiwiRmlsZUlkIjoiYmMzNmZkOWYtOGQ0NS00YjAxLTgzYWYtNmYzZjk0NDZjM2E1In0%3D"
our attempt to download from this url was to browse for:
>> [our_D365_environment_url] / [docuURL]
But this did not work, unless an Admin user is logged to a D365 session, which of course is not our scenario.
Any help?! We do appreciate.