Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

NavVariant variable not initialized

(2) ShareShare
ReportReport
Posted on by
Hello!

I have a problem with the approvals of PO, SO, SOF, SI. 
When I submit an approval request and someone attempts to approve, the following error occurs and is not approved.
Microsoft.Dynamics.Nav.Runtime.NavVariant variable not initialized I dropped the debugger to see where she stopped and stopped here at the point in red:

OBJECT Codeunit 1501 Workflow Management

LOCAL PROCEDURE ExecuteQueuedEvents@21();
VAR
WorkflowEventQueue@1001 : Record 1522;
WorkflowStepInstance@1003 : Record 1504;
WorkflowRule@1006 : Record 1524;
RecRef@1000 : RecordRef;
xRecRef@1002 : RecordRef;
Variant@1004 : Variant;
xVariant@1005 : Variant;
BEGIN
WorkflowEventQueue.SETRANGE("Session ID",SESSIONID);
IF WorkflowEventQueue.FINDSET THEN
REPEAT
WorkflowStepInstance.GET(WorkflowEventQueue."Step Record ID");
IF WorkflowStepInstance.Status = WorkflowStepInstance.Status::Processing THEN BEGIN
WorkflowRecordManagement.RestoreRecord(WorkflowEventQueue."Record Index",Variant);
WorkflowRecordManagement.RestoreRecord(WorkflowEventQueue."xRecord Index",xVariant);
RecRef.GETTABLE(Variant);
xRecRef.GETTABLE(xVariant);
WorkflowStepInstance.FindWorkflowRules(WorkflowRule);
IF EvaluateCondition(RecRef,xRecRef,WorkflowStepInstance.Argument,WorkflowRule) THEN BEGIN
ExecuteResponses(RecRef,xRecRef,WorkflowStepInstance);
WorkflowEventQueue.DELETE;
END;
END;
UNTIL WorkflowEventQueue.NEXT = 0;

END;


When a person exits and enters a new one in the system, the request is approved and there is no error.

What could be the problem, I use a standard workflow with Bulgarian localization?

*This post is locked for comments

  • Suggested answer
    MV-01100943-0 Profile Picture
    on at
    NavVariant variable not initialized
    Hi all,
     
    We have been dealing with the same issue recently and I have found this post that describes exact same problem and place in code where the errors occurs: http://www.msdynamics.de/viewtopic.php?f=74&t=37201. Google translate did a good job at translating the post. We have implemented the change suggest in the article just now and waiting for the results.
  • Jonathan Lemasara Profile Picture
    on at
    RE: NavVariant variable not initialized

    Hello,

    What have you done to resolve this issue. I am having the same problem. Please assist.

  • Verified answer
    YuliyanR Profile Picture
    on at
    RE: NavVariant variable not initialized

    Hello, Hicham Issa!

    I found a solution to the problem, but I guess there is some queue that sends for approval those that have not been sent. There is a Table 5122 -Workflow Event Queue that keeps sessions that have not been completed. When someone enters the system and the session coincides with some of the approval entries, this error occurs when the list is cleared, everything is fine.

  • Hicham Issa Profile Picture
    on at
    RE: NavVariant variable not initialized

    Hi YuliyanR,

    It is interesting that no one got back to you on this at all!

    either way, I have the same issue you are/were facing obviously.

    Any luck resolving this yet?

    My problem is related to an SQL connection issue as there was some recent server patching which probably caused this. For now we do not have a specific root cause but as you have described logging out and back in again resolve the issue. Also a service restart resolve the issue for quiet a while before it re-appears again (Usually on the second day after service restart)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans