Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

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

Posted on by 35
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 35 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans