Technical Notes, Zetadocs

PRB: License error when non Zetadocs user accesses a form with the embedded addin

ZTN4201

ID: ZTN4201

This Zetadocs technical note applies to:

  • Version 4.x and 5 of Zetadocs for NAV

Symptom

When a non Zetadocs user accesses a form that was configured to use the embedded Zetadocs addin and they have not installed Zetadocs for NAV on their machine, they get an error stating that they need to be licensed to use Zetadocs and then Microsoft Dynamics NAV crashes.

Cause

When the user opens the form and the embedded addin code is executed, it is trying to find out if the Zetadocs for NAV has a valid license. Since the Zetadocs for NAV is not installed on that specific user’s PC the check fails to find the appropriate library and generates an error.

Resolution

Zetadocs provides a function that informs you if the Zetadocs for NAV is installed. This function can be found in the Zetadocs Utilities codeunit (9009959) and it is called isZetadocsInstalled. The issue can be resolved by wrapping the SetRecordID function that is inserted in the form code with this function as a condition. The code can be seen below.

SetRecordID()

IF (ZetadocsUtilities.IsZetadocsInstalled) THEN BEGIN

  RecRef.GETTABLE(Rec);

  CurrForm.DragAndDropSubForm.FORM.SetRecordID(RecRef.RECORDID);

END;

An additional global variable needs to be created for the above code to work. The details of the variable are shown below:

  • Name: ZetadocsUtilities
  • DataType: Codeunit
  • SubType: Zetadocs-Utilities (ID:9009959)

Status

This fault can be corrected using the steps shown above.

Last updated: 30th August 2012 (AT/MW)

Keywords: Embedded addin error non Zetadocs user