Equisys technical notes

Technical guidance, explanations and fixes for our products

HOWTO: Adding Zetadocs for Microsoft Dynamics NAV features in other areas of NAV



ID: ZTN4274

This Zetadocs technical note applies to:

  • Zetadocs for Microsoft Dynamics NAV
  • Zetadocs Express


This technote details the steps required to add Zetadocs Document Factbox features in non Sales and Purchase areas of NAV.

More information

Zetadocs for NAV has been optimised for Sales and Purchase documents but its functionality can be added to other areas of NAV to provide the same functionality. The steps below are required to enable Zetadocs to access vital metadata on your NAV records which is used during archiving process.

Adding additional references to the Metadata information into the Zetadocs Metadata Mappings Table

The Zetadocs configuration files contain details of the fields to use for metadata for the Sales and Purchase Header tables. Therefore to extend the functionality beyond Sales and Purchase documents you must add additional references for the Organisation Name and the Record No. to the Zetadocs Metadata Mappings table. If this is not done and a user attempts to archive documents based upon Company name, then Zetadocs will not be able to archive the document as it will not have access to this information. The steps below add the company name and record no. to the Service Header table, but the steps can be repeated for other areas of NAV by changing the Table and Table Field ID details as required.

Please note: If you are adding a new piece of metadata in the table then you should add a new corresponding SharePoint column within the Zetadocs content type.

  • Open the object designer (Shift + F12) and locate the table which contains the details for the form/page you wish to configure, in this case the Service Header Table (5900) and select Design.
  • Locate the fields which contain the name of the organisation and the record no. and make note of the field IDs (79 and 3 respectively for the Service Header Table).
  • Return to the object designer and run the Zetadocs Metadata Mappings Table (9041212).
  • Scroll to the bottom of the list and enter the Table ID, in this case the Service Header Table ID: 5900 into the Table ID field.
  • Next enter the value ZetadocsOrganisation into the Metadata Field Name and 79 into the Table Field ID.
  • Finally add the record no. entry by selecting the bottom row and entering the Table ID (5900 in this example) before adding the value ZetadocsRecordNo into the Metadata Field Name and 3 into the Table Field ID.

Adding the Document Factbox to pages

  • Open the object designer (Shift + F12) and select the page that needs to be modified and click the Design button, in this example we will be looking at the Employee card.
  • Add the following entry inside the < Control1900000001> section:
    • Name:Zetadocs
    • Caption:< Zetadocs>
    • Type:Part
  • The Zetadocs Related Documents Grid will appear in this location, as such you can choose where you wish to display it. You can enter the line between, on top of, or at the bottom of the other controls.
  • For example, putting the line on top of Control1 will place the related documents list at the top of the Employee Card page in the RTC.
  • Place the Zetadocs line in a suitable location, if unsure view the page and find the entry below which you wish it to appear and place it there.
  • Once you've added the line select it and open the properties (shift+F4) for it.
  • Scroll down to the PagePartID field and select Zetadocs Rel. Docs. Page Part, 9041209.

  • Select View > CA/L Globals and select the Variable tab, create a new global variable with the values:
    • Name: RecRef 
    • Type: RecordRef
  • The Documents FactBox can now be used in the Role Tailored Client.

Adding Capture Essentials Features to Forms

To add Capture Essentials to a specific form you need to do the following.

  • Open the object designer (Shift + F12) and select the form that needs to be modified and click the Design button.
  • When the Design view opens select View > CA/L Globals.
  • Create a global variable with the characteristics:
    • Name: RecRef 
    • Type: RecordRef
  • Select the Functions tab and then create a global function
    • Name: SetRecordID
  • Click View > C/AL Code or press F9 to open the C/AL Editor, scroll down the list until you reach the SetRecordID section.
  • Add the following code:



  • Create a subform from the toolbox and place above the buttons making it the width of the items grid.
  • Select the Properties for the new subform and give it the following properties:
    • Name: DragAndDropSubForm
    • HorzGlue: Both
    • VertGlue: Bottom
    • Border: No
    • SubFormID: Zetadocs Drag and Drop Subform (ID:9010010)   

  • Select the main form again and click View > C/AL Code or press F9 to open the C/AL Editor.
  • Next copy the following code into the bottom of both the OnAfterGetRecord and OnNewRecord triggers of the form:


  • Note that to enable the drag and drop control, focus is taken from the default field on opening of the form. If you wish to have the focus restored to the standard starting point for the user, add the following code to the bottom of the OnOpenForm trigger.

CurrForm.< controlname> .ACTIVATE;

(E.G. CurrForm."No.".ACTIVATE;)

  • You can now drag and drop documents onto this form, repeat this process for any remaining forms you wish to add the Zetadocs Capture Essentials Drag and Drop control to.

Last updated 19th August 2013 (MW/)

Equisys Logo, Document Management and Expense Management for Business Central

Replaced by script