Installation guide
Zetadocs for NAV Installation Guide
This edition 5
th
December 2012 © Copyright Equisys plc 2012 All trademarks acknowledged All rights
reserved
Page 81
<EnableBarcodeDetection>true</EnableBarcodeDetection>
</Config>
Accessing the extracted text file from NAV
Once you have enabled the text extraction in the Zetadocs Server you will need to implement parsing of the
text file in NAV. This is done using the Zetadocs Capture Customize codeunit.
In the Zetadocs- Capture Customize codeunit trigger GetAutoLink() the path to the control file for queue
items is available as the ZdControlFile :Text[250] parameter. Using this you can call a Zetadocs Utilities
function to return the associated extracted text file path for that item.
textFilePath := ZdUtilities.GetExtractedTextFilePath(ZdControlFile);
You can now implement your own functionality to parse the text file for expected text metadata which will
help you to identify the document and its associated record in much the same manner as is described for
the barcode recognition feature of Zetadocs for NAV. For more information, please see section 12.
13.2 Approvals in NAV using Extracted Text
Now that we have successfully identified and extracted the information we require we can put it to work in
NAV, in this example we will be setting NAV so that it starts an approval process.
In this example we will be looking at the following business process:
Raise and send out a purchase order from NAV using Zetadocs
Received by the vendor who will raise a sales order and send the goods.
They will attach a shipment note to the delivery and also send a purchase order.
These documents will be Captured into the relevant Zetadocs Document Queue either via scanning
of hardcopies or processing of other documents by the Zetadocs Server.
When the Purchase Invoice is Captured, Zetadocs extracts the text including the original purchase
order number.
When the Purchase Invoice is processed and added to the Zetadocs Archive this set in motion the
approval process in NAV.
The existing Document Queues as setup by default do not support the initialization of the approval process.
As such we need to adjust the Zetadocs-Capture Customize codeunit so that it begins the approval process
when an invoice is archived.
Creating the IsValueInFile function
Select the Zetadocs-Capture Customize codeunit in the object designer, and select Design.
Select ViewC/AL Globals and choose the functions tab.
Add the function IsValueInFile, details below.
Name
IsValueInFile ( Value, FilePath )
Description
Searches if a given Value is present in the file pointed by FilePath
Arguments
Value text[30] The value to search for
FilePath text[1024] The associated text file to look in
Returned value
True if the number is present
False if not
Adding Code into the IsValueInFile function
Now that we have added the function into the codeunit we need to add the following code, open the C/AL
editor (F9) and paste in the code below into the IsValueInFile section. We recommend that you review this
now to gain an understanding of how it operates, comments have been included throughout to explain the
various sections.
CODE:
IsValueInFile(text[30] Value; text[1024] FilePath)
{
// Set file to be opened in text mode and for reading only
file.TEXTMODE(TRUE);