Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Decode a Base64 attachment file from XML (PEPPOL BIS 3.0 Invoice) and attach invoice created

Posted on by 33
Hello Team, 
 
I have a requirement to decode a base 64 attachment file in the Peppol bis 3.0 xml invoice file and attach the decoded file to pending vendor invoice created.
 
Please suggest me any reference document for this.
 
1. How to decode the base64 file attachment in XML
2. How to attach the same to pending vendor lines created
 
 
  • Suggested answer
    Monikasree GM Profile Picture
    Monikasree GM 33 on at
    Decode a Base64 attachment file from XML (PEPPOL BIS 3.0 Invoice) and attach invoice created
    Hello @RudyZhang,
     
    Thank you for the below information.
     
    I have retrieved the Base64 string from XML and I have used the below code to convert the base64 to DocuValueFile and stored the attachment in DocuValue table.
     
    DocuValueFile file = BinData::loadFromBase64(base64File);
     
    Regards,
    Monika
  • Suggested answer
    RudyZhang Profile Picture
    RudyZhang Microsoft Employee on at
    Decode a Base64 attachment file from XML (PEPPOL BIS 3.0 Invoice) and attach invoice created
    Hi,
     
    May I ask if your problem has been solved?
    You can try my solution and contact me if you need any help.
     
     
    Best Regards,
    Rudy Zhang
  • RudyZhang Profile Picture
    RudyZhang Microsoft Employee on at
    Decode a Base64 attachment file from XML (PEPPOL BIS 3.0 Invoice) and attach invoice created
    Hi,
     
    Our search shows that you can use the /Convert.FromBase64String/ method to decode Base64 encoded data.
     
    There is some sample code in the official document at the link below to help you understand and use this method better.
    https://learn.microsoft.com/en-us/dotnet/api/system.convert.frombase64string?view=net-7.0
     
    Additionally, if you are using Dynamics 365 BC you can refer to the following documentation to add attachments to your invoices.
    https://learn.microsoft.com/en-us/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice
     
     
     
     
    I hope my answer is helpful to you! If you have any other questions, please feel free to contact me.
     
    Best Regards,
    Rudy Zhang

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans