web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Error when trying to import a file attachment (2nd instance)

(1) ShareShare
ReportReport
Posted on by 30

Hi All,

I am creating an invoice and attaching its PDF file using Power Automate. But I am getting an error in D365-->F&O when trying to attach a second PDF file. Kindly help.

The scenario is this:

1. Create an invoice in D365->Finance and Operations via Power Automate.

2. Attaching the PDF file (Test.pdf) to the invoice via Power Automate (using a data package).  

3. Invoice is created successfully in F&O. PDF file is attached successfully to the invoice. 

4. Attach another PDF file (Test2.pdf) to the invoice. ***Note***: I used the same Test.pdf file and just renamed it to Test2.pdf. Power Automate ran successfully but the file Test2.pdf was not attached to the invoice. The job execution prompts the error below

Execution details:

pastedimage1662753850667v3.png

Error:

pastedimage1662753489265v2.png

I have the same question (0)
  • Suggested answer
    nunomaia Profile Picture
    25 Moderator on at

    Data entity is using invoice number document as primary key.

    Data entity supports a single attachment. When you attach a second document you are not inserting a new attachment  but updating the existing one. Updating that is not supported in data entity.

    You need to extend data entity to support that 

  • joelhtown80 Profile Picture
    30 on at

    Hi nunomaia,

    I'm new to this but can you guide me on how to extend the data entity?

  • Suggested answer
    SimonPalmert Profile Picture
    15 on at
    Hi,

    The field FileContents and FileName are both computed columns. This means that they cannot be directly used for insert/update events without additional post-event logic (Computed columns and virtual fields in data entities - Finance & Operations | Dynamics 365 | Microsoft Learn).
     
    See standard insertEntityDataSource method on DocuRefEntity for reference on how inserts are managed:
     
    So, for updates you would need to implement post-event logic to the updateEntityDataSource method in the same manner. Since this is not available in standard, it could be a process that should not be performed. You would need to investigate how updates to attached files are done in other scenarios.
     

Under review

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans