Equisys technical notes

Technical guidance, explanations and fixes for our products

HOWTO: Manually modify NAV pages to work with Zetadocs

Print

ZTN4275

ID: ZTN4275

This Zetadocs technical note applies to:

  • Zetadocs for Microsoft Dynamics NAV
  • Zetadocs Express

Summary

This technote details the steps required to manually modify the NAV pages and forms to work with Zetadocs. These steps are normally used when the modification tools provided by Equisys are not suitable due to existing modification of these NAV objects.

More information

This technote contains the steps to manually configure NAV pages and forms to work with Zetadocs both for Capture and Delivery.

Zetadocs NAV Server Delivery – Adding Delivery buttons to the page ribbon

For NAV 2015 and later

Please follow the steps to add the Zetadocs NAV Server Delivery Send button to list or card pages in NAV, i.e. Sales Order List page (#9305):

  • Open the object designer in the development environment. Select Pages.
  • Select the page that you would like to modify, for example Sales Order List page (#9305), and click design.
  • Go to View>Page Actions and create a new ActionGroup, call it ‘Zetadocs’.
  • Create a new action, call it ‘Send’.
  • Select the ‘Send’ Action and go to the code, press F9.
  • In the function create a new line of code as follows:
    • ZdRecRef.GETTABLE(Rec);
      IF ZdRecRef.GET(ZdRecRef.RECORDID) THEN
      BEGIN
         ZdServerSend.InitRequestPageWithRecord(, ZdRecRef.RECORDID);
      END;
      ZdServerSend.SendServerDelivery(, '', TRUE);

      Where is the ID of the report that you would like to run.

  • Create a new Local variable. View>C/AL Locals:
  • Name

    DataType

    SubType

    ZdServerSend

    Codeunit

    Zetadocs-Server Send

    ZdRecRef

    RecordRef

  • Save, compile and close the page.

Additionally you can add the Outbox button which will allow you to quickly access the Zetadocs NAV Server Delivery Outbox to monitor the status of a delivery. To do so follow the steps below:

  • Open the object designer in the development environment. Select Pages.
  • Select the page that you would like to modify, for example Sales Order List page (#9305), and click design.
  • Go to View>Page Actions and create a new action, call it ‘Outbox’
  • Go to Properties (Shift+F4)
  • Set the RunObject property to Zetadocs Delivery Outbox
  • Save, compile and close the page

Optionally, to allow users to adjust the ZetadocsRules for a customer or vendor from on the relevant card you can add a Rules Button to the Ribbon.

  • Select the page that you would like to modify, for example Sales Order List page (#9305), and click design.
  • Go to View>Page Actions and create a new action, call it ‘Rules’
  • Go to Properties (Shift+F4)
  • Set the RunObject property to Zetadocs Customer Rule List
  • Save, compile and close the page

Zetadocs Capture – Adding the Documents FactBox

For NAV 2013 R2 and later

  • 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 at the top of the FactBox area
    • Name: WebClient
    • Caption: Documents
    • Type: Part
    • Subtype: Page
  • 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 Web Rel. Docs. Page, ID: 9041211.
  • Then scroll up to the Visible field and type ZDWebAddinVisible.
  • Close the Properties dialog.
  • Add the following entry below the WebClient entry in the FactBox area
    • Name: Zetadocs
    • Caption: Documents
    • Type: Part
    • Subtype: Page
  • 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, ID:9041209.
  • Then scroll up to the Visible field and type ZDWinAddinVisible.
  • Close the Properties dialog.
  • Select View>CA/L Globals and select the Variable tab, create four new global variables with the values:
    • Name: ZdRecRef
    • DataType: RecordRef
    • ----
    • Name: ZDWinAddinVisible
    • DataType: Boolean
    • ----
    • Name: ZDWebAddinVisible
    • DataType: Boolean
    • ----
    • Name: ZDSaveAndSendVisible
    • DataType: Boolean
    • ----
    • Name: ZdPrevRecID
    • DataType: RecordID
  • Close the CA/L Globals dialog.
  • Click View>C/AL Code or press F9 to open the C/AL Editor, scroll down to the OnAfterGetCurrRecord section and append the following:
    • IF GUIALLOWED THEN
      BEGIN
        ZdRecRef.GETTABLE(Rec);
        IF ZdRecRef.GET(ZdRecRef.RECORDID) AND (ZdRecRef.RECORDID <> ZdPrevRecID) THEN
        BEGIN
          ZdPrevRecID := ZdRecRef.RECORDID;
          IF ZDWinAddinVisible THEN
          BEGIN
            CurrPage.Zetadocs.PAGE.SetRecordID(ZdRecRef.RECORDID);
            CurrPage.Zetadocs.PAGE.ACTIVATE(TRUE);
          END;
          IF ZDWebAddinVisible THEN
          BEGIN
            CurrPage.WebClient.PAGE.SetRecordID(ZdRecRef.RECORDID);
            CurrPage.WebClient.PAGE.UPDATE;
          END;
        END;
      END;

  • Scroll up to the OnInit section.
  • Select View > CA/L Locals and select the Variables tab, create a new local variable with the values:
    • Name: ZDAddin
    • DataType: Codeunit
    • Subtype: Zetadocs-Capture Addin
  • Close the CA/L Locals dialog.
  • In the OnInit section enter the following:
    • ZDWinAddinVisible := ZDAddin.IsWebClient OR ZDAddin.IsWinClientAddinPresent;
      ZDWebAddinVisible := ZDAddin.IsWebClient OR (NOT ZDWinAddinVisible);
      ZDSaveAndSendVisible := ZDAddin.IsWinClientAddinPresent;

  • Close the page and compile it. The Document FactBox can now be used in the NAV Windows client (RTC) or NAV Web Client.

Zetadocs Capture – Adding the Documents FactBox

For NAV 2013 and earlier - Windows Client/Role Tailored Client

Should you decide not to install the Zetadocs for NAV Interfaces .fob file relevant to your NAV version, the instructions below can be performed to add the related Document FactBox, including the Capture Essentials features if licensed, to your Role Tailored Client pages as required.

  • Log into Microsoft NAV as a user with SUPER user permission rights to allow you to import new objects into the NAV database.
  • Open the object designer (Shift + F12) and select the page that needs to be modified and click the Design button.
  • Locate the FactBoxArea on the page, it is usually at the bottom.
  • Insert a new row at the top in the FactBoxArea container and enter the following information
    • Name: Zetadocs
    • Caption: Documents (Or translated equivalent)
    • Type: Part
    • SubType: Page

    http://www.equisys.com/technotes/ZTN4275_files/4275_1.png

  • Select the new line and press Shift+F4 to show the properties window.
  • Change the PagepartID to Zetadocs Rel. Docs. Page Part Object ID 9041211. It should look something like the screenshots displayed below:
  • http://www.equisys.com/technotes/ZTN4275_files/4275_2.png

  • Press F9 to display the code window.
  • In the OnAfterGetRecord() trigger add a local variable:
    • Name: ZdRecRef
    • DataType: RecordRef
    • ----
    • Name: ZdPrevRecID
    • DataType: RecordID
  • In the trigger add the following code:
  • For NAV 2013 systems:

    ZdRecRef.GETTABLE(Rec);
    IF ZdRecRef.GET(ZdRecRef.RECORDID) AND (ZdRecRef.RECORDID <> ZdPrevRecID) THEN
    BEGIN
      ZdPrevRecID := ZdRecRef.RECORDID;
      CurrPage.Zetadocs.PAGE.SetRecordID(ZdRecRef.RECORDID);
      CurrPage.Zetadocs.PAGE.ACTIVATE(TRUE);
    END;

    For NAV 2009 systems:

    ZdRecRef.GETTABLE(Rec);
    IF ZdRecRef.GET(ZdRecRef.RECORDID) THEN
    BEGIN
      CurrPage.Zetadocs.FORM.SetRecordID(ZdRecRef.RECORDID);
    END;

  • Close the page designer windows.
  • Click Yes when prompted to compile and save the changes.

Zetadocs Capture – Adding the Zetadocs Archive Menu

For NAV 2009 and earlier – Classic Client (Forms)

If when attempting to import the Zetadocs for NAV forms into NAV you have collisions which make it impractical to import the forms the following manual steps can be performed to provide the same functionality.

SharePoint Archiving

The following changes enable display of the related document grid form which shows existing archived documents from the record in question.

Adding the Zetadocs Archive menu item to the Sales Quote Card

  • Log into Microsoft NAV as a user with SUPER user permission rights to allow you to import new objects into the NAV database.
  • Open the object designer (Shift + F12) and select the form that needs to be modified and click the Design button.
  • In this example we will look at modifying a Sales Quote form, for other form modifications please follow these steps and select the option relevant to your form when prompted.
  • Right-click on the Quote button, or the corresponding button on your form, and select Menu Items.
  • Scroll down and at the bottom add a separator by using the Separator button.
  • Add a menu item with caption Zetadocs Archive or a suitable localised equivalent.
  • Add a shift+ctrl+A in the ShortCutKey field.
  • http://www.equisys.com/technotes/ZTN4275_files/4275_4.png

  • While still on the Zetadocs Archive menu item, open up the C/AL Code editor by pressing F9.
  • In the OnPush () trigger of the menu item add a local variable (View > Cal Locals):
    • Name: RecRef
    • DataType: RecordRef
  • Add a second local variable
    • Name: ZetadocsUtilities
    • DataType: Codeunit
    • Subtype: Zetadocs-Utilities
    • Note: You may find it easier to locate the Zetadocs-Utilities using its ID code 9009959.

    http://www.equisys.com/technotes/ZTN4275_files/4275_5.png

  • Next, add the following code into the OnPush() trigger of the menu item:
    • RecRef.GETTABLE(Rec);
      ZetadocsUtilities.ShowCaptureAddinForm (RecRef.RECORDID, STRSUBSTNO('%1-%2', CurrForm.CAPTION, " No." ));

  • Close the form designer windows.
  • Click Yes when prompted to compile and save the changes.
  • Repeat this process for any other required forms.

Last updated: 31st March 2016 (JV/GC/WK/SB/JC)

EquisysLogo

Recent news

This article describes the new features and other improvements in the October 2019 release of the Zetadocs Expenses service. Zetadocs Expenses Release date and version ...

What to expect if you’re attending Directions EMEA 2019

It’s that time of year again. Directions EMEA is right around the corner. This year, it takes place at the Austria Center in Vienna, between 9-11 October. Traditionally, Directions NA would take ...

Monday, September 23, 2019