Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : zrj9ReYE4NTgH/54w6hDzW
Microsoft Dynamics NAV (Archived)

NavVariant variable not initialized

Like (2) ShareShare
ReportReport
Posted on 22 Aug 2018 07:11:38 by 111
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
    2 on 01 Oct 2024 at 09:46:41
    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
    15 on 25 Aug 2021 at 06:07:47
    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
    111 on 28 Nov 2018 at 14:40:25
    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
    5 on 31 Oct 2018 at 11:45:34
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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... 293,333 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,262 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading started