Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

NavVariant variable not initialized

Posted on by 105
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
    MV-01100943-0 2 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.
  • 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
    YuliyanR 105 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
    Hicham Issa 5 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,946 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,443 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans