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 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans