Installation guide

Zetadocs for NAV Installation Guide
This edition 5
th
December 2012 © Copyright Equisys plc 2012 All trademarks acknowledged All rights
reserved
Page 66
Add permissions to codeunit
Test document archiving
The following sections provide more detail on each step.
Write code in the GetLink function
For each action that is defined for the Archive button, you need to write some code in the function GetLink,
to carry out that action in NAV.
For example, if the action is to link the captured document to an existing record, then in this function you
would code the lookup that displays a form to allow the user to select the record and then return that
RecordID. Zetadocs will then use the record ID during the document archive and extract the correct
metadata.
The GetLink function has the following parameters:
Name
Type
Sub-type
Read/Write
Description
ZdArchiveContext
Record
Zetadocs
Archive
Context
Read
A read only runtime table to
provide context information like
the queue the item is in and the
menu item that was clicked by
the user.
ZdLinkResult
Record
Zetadocs Link
Result
Read/Write
A writable runtime table to allow
you to return the un-typed
RecordID reference to a NAV
record, error states and
messaging.
ZdControlFile
Text
[250]
Read
Path to the DQF file for the
document queue item (XML file).
Provided to allow you to fetch
other information about
converted files.
Sample Code:
This sample code shows an implementation of the GetLink function allowing the user to select the
associated Sales Shipment record. Note that this function will be called for every Action. You will need to
add a CASE statement using the Menu Code ID to identify the action the user has selected and write the
appropriate code against each case.
PROCEDURE GetLink@1000000007(ZdArchiveContext@1000000000 : Record 9009992;VAR
ZdLinkResult@1000000001 : Record 9009997;ZdControlFile@1000000002 : Text[250]);
VAR
SalesShipmentRec@1000000003 : Record 110;
RecRef@1000000004 : RecordRef;
BEGIN
ZdUtilities.Log(0, 'C9009964 - Link');
// Menu Code ID find out what action to perform
// if there are any errors during processing set the error flag in ZdLinkResult to TRUE
// and set the error description field to a useful error message
CASE ZdArchiveContext."Menu Code ID" OF
'ZDSHIP': // link to existing sales shipment
BEGIN
// make sure the sales shipment record does not have any filters
SalesShipmentRec.RESET;
// run the lookup form and check the result
IF FORM.RUNMODAL(0, SalesShipmentRec) = ACTION::LookupOK THEN
BEGIN