Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Update Dimensions onValidate() of Location in Item Journal Line in NAV

Posted on by Microsoft Employee

Hi Experts, 

I want to Update Global Dimension 1 (Business Unit) and Global Dimension 2 (District Code) onValidate() trigger of Location Code in Item Journal Line table. I have already assigned dimensions to every Location that I have. Now I want to update them in Item Journal through Item Journal Line table (OnValidate of Location Code as mentioned earlier).

Is there any standard way in NAV, to perform this activity? 

This requirement is on urgent basis and I would appreciate any help/suggestion regarding this. 

Thanks in advance. 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

    Hi,

    Thank you all for your suggestions.

    I had solved the issue by using CreateDim function by adding Location Code as an additional Parameter.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

    Add the code in the OnAfterValidate of the Location code to update the Shortcut Dimension 1 Code and Dimension 2 Code.

    ItemJnlLine."Shortcut Dimension 1 Code" := 'abc..';

    ItemJnlLine."Shortcut Dimension 2 Code" := 'a1222'

    DimMgt.UpdateGlobalDimFromDimSetID(
    ItemJnlLine."Dimension Set ID",ItemJnlLine."Shortcut Dimension 1 Code",ItemJnlLine."Shortcut Dimension 2 Code");

  • Suggested answer
    TeddyH Profile Picture
    TeddyH 12,868 Super User 2024 Season 1 on at
    RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

    Go to Item Journal Line and take a look at how they do Dimension when validating the Item No.

    You will need to follow the same rule and replicate it to Location Code.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

    Thank you for your quick reply.

    Can you please elaborate as to how that can be done based on Location Code?

  • Verified answer
    I Gusti Made Ari Profile Picture
    I Gusti Made Ari 3,594 on at
    RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

    No for standard , you need to customize a bit  for that. On Item Journal , standard only populate dimension  based on default dimension in Item, Salesperson and workcenter.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans