Installation guide
Zetadocs for NAV Installation Guide
This edition 5
th
December 2012 © Copyright Equisys plc 2012 All trademarks acknowledged All rights
reserved
Page 72
12.3 Adding code to the GetLinkDisplayString function
Zetadocs calls the function GetLinkDisplayString to allow you to return a suitable text string to be
displayed in the document queue form. If no value is returned by this function, then the display will default
to the barcode text for the first barcode found in the captured document. If the document contains multiple
barcodes, these will be represented as multiple records in the table.
The GetLinkDisplayString function has the following parameters:
Parameter
Type
Sub-type
Read/Write
Description
ZdDocQueueBarcodes
Record
Zetadocs
Doc. Queue
Barcodes
Read
A read only runtime table that
allows you to access the values of
all barcodes from the document
queue item.
Return Value
Text[120]
Write
The text to display in the
document queue “Link” column.
Open the NAV Development Environment/classic client and open the Object Designer (Shift+F12).
Locate the Codeunit ID:9009964 Zetadocs-Capture Customise in the Object Designer and select
Design.
Scroll down to the GetLinkDisplayString section.
You will notice the code matches that displayed below, this indicates that it is setup for the
Shipment Report, which we provide as a sample report.
To add support for other reports we need to add additional if statements to ensure your system is
configured to deal with barcodes which start with other details.
Sample Code:
This sample code shows an implementation of GetLinkDisplayString that returns a display string for a
Shipment record.
// Call reset to clear any filters that may be on the barcodes temporary table
ZdDocQueueItemBarcodes.RESET;
IF NOT ZdDocQueueItemBarcodes.FIND('-') THEN
BEGIN
// There are no barcodes so we leave the link string blank
EXIT('');
END;
info := ZdDocQueueItemBarcodes.Value;
// if the barcode starts with SHIP
IF (STRLEN(info) > 4) AND (COPYSTR(info, 1, 4) = 'SHIP') THEN
BEGIN
info := STRSUBSTNO(strSalesShipment, COPYSTR(info, 5));
END;
END;
Customising the GetLinkDisplayString function
The document specific section of code below contains an IF statement which enables the codeunit to add
additional information to the document queue when it detects a barcode which begins with SHIP. The
makeup of this string is obviously determined by the unique value you wish to use for your barcode.
String in the report which generates the barcode
SourceExpr = STRSUBSTNO('*SHIP%1*',"Sales Shipment Header"."No.")
This would for example generate a value of *SHIP 102028*.
Corresponding code required in the codeunit
// if the barcode starts with SHIP