Skip to main content
Dynamics 365 general forum
Suggested answer

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

editSubscribe (0) ShareShare
ReportReport
Posted on by 32
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 32 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 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 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

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans