Solved: Type 'Action' not defined in Function - Error


half of the day I searched for the reason of a “Type ‘Action’ not defined in Function” Errormessage from the NAS. Not it is found. If the NAS touchs an object which has a local or global Variable of Type and (!) somewhere in the code you put an expression on the Actioncodes like this:

IF (lac_Aktion = lac_Aktion::LookupOK) OR (lac_Aktion = lac_Aktion::OK) OR
(lac_Aktion = lac_Aktion::Yes) THEN BEGIN

then NAS will interrupt with the written Errormessage.

It is important to know that the NAS will also crash if it doesn’t run the Code with the Action. In my case the code was placed in another Function in the same Codeunit (as a local Variable). The NAS never runs this code but it crashs when accessing the Codeunit where it is placed!

I am also getting this error in event viewer and so far not able to sort this out. Please let me know if anybody has any idea on this.

So you really checked every object which will be touched through Code from NAS for an Action Variable? Remember that the error also occurs if the given object only contains (!) such a variable and not only if NAS runs the code with this variable! Maybe it helps to export the touched objects as text and search inside the textfiles for variable of type “action”?