Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

Vendor invoice automation (OCR) in Microsoft Dynamics 365 for Finance and Operations

Rahul Mohta Profile Picture Rahul Mohta 21,026

OCR/Scan vendor invoice automation in Microsoft Dynamics 365 for Finance and Operations

OCR solution uses data import using data entities and is currently attached vendor invoice document to pending vendor invoices.

 

Sharing solution composition and steps and tips:

 

data entities used for the artifacts that make up the data package for Vendor invoice automation/OCR are:

  • Vendor invoice header
    • The Vendor invoice header entity has been modified so that it supports attachments.
  • Vendor invoice line
    • Vendor invoice line entity hasn’t been modified for this feature.
  • Vendor invoice document attachment
    • It is a new data entity that is introduced as part of this OCR feature.
    • It is also important to note that since the document attachment contains a binary file (the image) the import must be made through a data package.

 pastedimage1596179364478v1.png

 

Sharing key fields in Excel for entity for Vendor invoice header:

  • HeaderReference (must be unique)
  • IsApproved (Must be set to No)
  • Currency (of vendor invoice)
  • Date (Posting date)
  • InvoiceAccount
  • InvoiceDate
  • InvoiceNumber
  • VendorAccount
  • PURCHASEORDERNUMBER

 

 pastedimage1596179370579v2.png

Ensure details in Excel file for Vendor invoice document attachment on important fields :

  • HeaderReference (this is important to link the invoice image to the invoice header details being imported)
  • DocumentId (must be a GUID format)

For GUID generation in Excel, could use below formula

=CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),"-",DEC2HEX(RANDBETWEEN(0,65535),4),"-",DEC2HEX(RANDBETWEEN(16384,20479),4),"-",DEC2HEX(RANDBETWEEN(32768,49151),4),"-",DEC2HEX(RANDBETWEEN(0,65535),4),DEC2HEX(RANDBETWEEN(0,4294967295),8))

 

  • DefaultAttachment (must be set to Yes)
  • FileName (no extension)
  • FileType (file extension).
  • TypeId (use value as Image)
  • FileContentsFileName (only the full name of the file with extension, no windows folder/directory path)

 

 pastedimage1596179386256v3.png

 

 

Error handling:

 

Error#1 While uploading data package- Could not find file 'C:\windows\TEMP\1CE3ABF8-6445-40B9-BA77-F579E7A3D05D_D4B4D495-AE62-4ADF-A25A-0298DD098667\PackageHeader.xml

RCA- PackageHeader.xml file is not at the root level in data package zip

Solution-Ensure all files and resources folder are zip together at the filer and folder level and a not a folder level above

 

Error#2 Failure to process data entity  Vendor invoice document attachment. Results. 'FileContents' is required when attaching a file. Results. validateWrite failed on data source 'DocuRefEntity (DocuRefEntity)'

RCA- FileContentsFileName  is not having file extension

 

 After importing data package successfully, one can see the vendor invoice and it's attachment as below

pastedimage1596179411874v4.png

 

Place to see all Exceptions available at Accounts payable > Invoices > Import failures > Vendor invoices that failed to import

 

Comments

*This post is locked for comments