Installation guide
Zetadocs for NAV Installation Guide
This edition 5
th
December 2012 © Copyright Equisys plc 2012 All trademarks acknowledged All rights
reserved
Page 67
// if the user selected a record use a RecordRef to get the RecordID for the record
// and modify the ZdLinkResult record to include it
RecRef.GETTABLE(SalesShipmentRec);
ZdLinkResult."Record ID" := RecRef.RECORDID;
END
ELSE
BEGIN
// if the user cancelled, set the cancel flag in ZdLinkResult to true
ZdLinkResult.Cancel := TRUE;
END;
// Call MODIFY to save the changes to the record
ZdLinkResult.MODIFY;
END;
END;
END;
Write code in the GetAdditionalMetadata function
Zetadocs calls the function GetAdditionalMetadata to get the values of metadata to be added to
SharePoint when the document is archived.
The GetAdditionalMetadata 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.
ZdArchiveMetadata
Record
Zetadocs
Archive
Metadata
Read/Write
A writable runtime table to allow
you to modify the field values
being archived to SharePoint and
to fill in custom metadata that has
multi-level table relations.
Sample Code:
This sample code shows an implementation of GetAdditionalMetadata that sets the values for the metadata
for Record Type, Record Number, Company Number, Name and Organization. Note that this function will be
called for every Action. You will need to add a CASE statement using the Record ID to identify the linked
record and then write the appropriate code against each case to pull the specific metadata required.
PROCEDURE GetAdditionalMetadata@1000000005(ZdArchiveContext@1000000000 : Record
9009992;ZdLinkResult@1000000001 : Record 9009997;VAR ZdArchiveMetadata@1000000002 : Record 9009993);
VAR
RecRef@1000000003 : RecordRef;
fRef@1000000004 : FieldRef;
BEGIN
ZdUtilities.Log(0, 'C9009964 - GetAdditionalMetadata');
// Use the record id to get the table number. From the table number we know which fields to get the metadata from.
// We are using short codes for the standard Zetadocs SharePoint fields.
// These codes will be translated into the correct field names.
// For custom fields just put the full field name in and it will be used.
IF RecRef.GET(ZdLinkResult."Record ID") THEN