Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

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. 

  • 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,640 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,861 Moderator 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,590 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans