Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Finding Default Dimension Values - NAV 2009

Posted on by 2

We had a custom report created for us called "Clear G/L Restrictions" and it seems to reset our dimensions to our default dimensions...possibly...where can I find our default dimensions as I assume they are different from our active dimensions?

Comments:

Modified to copy state of Default Dimension table to temp table, and restore values in "Set" mode

Only restore default dimensions that exist (this excludes dimensions that have been created between
running Clear and running Set.

A sample of the code is below.

IF ReportMode = ReportMode::Clear THEN BEGIN

Counter += 1;
Window.UPDATE (1,ROUND(Counter/Total*10000,1));
DefDimTemp.INIT;
DefDimTemp.TRANSFERFIELDS ("Default Dimension");
DefDimTemp.INSERT;
"Default Dimension".VALIDATE("Value Posting","Default Dimension"."Value Posting"::" ");
"Default Dimension".MODIFY(TRUE);
END ELSE IF ReportMode = ReportMode::Set THEN BEGIN
Counter += 1;
Window.UPDATE (1,ROUND(Counter/Total*10000,1));
IF DefDimTemp.GET ("Table ID","No.","Dimension Code") THEN BEGIN
"Value Posting" := DefDimTemp."Value Posting";
MODIFY(TRUE);
DefDimTemp.DELETE;
END;

*This post is locked for comments

  • edwardl Profile Picture
    edwardl 2 on at
    RE: Finding Default Dimension Values - NAV 2009

    The only data item is Default Dimension.

    Here is the complete code:

    Default Dimension - OnPreDataItem()

    IF DefDimTemp.FINDFIRST THEN

     IF ReportMode = ReportMode::Clear THEN

       IF NOT CONFIRM ('There are records in the temporary table that have not yet been restored.\' +

                       'The temporary table will be cleared if you proceed.') THEN

         CurrReport.QUIT

       ELSE

         DefDimTemp.DELETEALL;

    Total := COUNT;

    IF ReportMode = ReportMode::Clear THEN

     Window.OPEN ('Clearing\@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@@')

    ELSE

     Window.OPEN ('Restoring\@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');

    Default Dimension - OnAfterGetRecord()

    IF ReportMode = ReportMode::Clear THEN BEGIN

     Counter += 1;

     Window.UPDATE (1,ROUND(Counter/Total*10000,1));

     DefDimTemp.INIT;

     DefDimTemp.TRANSFERFIELDS ("Default Dimension");

     DefDimTemp.INSERT;

     "Default Dimension".VALIDATE("Value Posting","Default Dimension"."Value Posting"::" ");

     "Default Dimension".MODIFY(TRUE);

    END ELSE IF ReportMode = ReportMode::Set THEN BEGIN

     Counter += 1;

     Window.UPDATE (1,ROUND(Counter/Total*10000,1));

     IF DefDimTemp.GET ("Table ID","No.","Dimension Code") THEN BEGIN

       "Value Posting" := DefDimTemp."Value Posting";

       MODIFY(TRUE);

       DefDimTemp.DELETE;

     END;

     // old code

     {

     IF "Default Dimension"."Value Posting" = "Default Dimension"."Value Posting"::" " THEN BEGIN

       IF "Default Dimension"."Dimension Value Code" = '' THEN BEGIN

         "Default Dimension".VALIDATE("Value Posting","Default Dimension"."Value Posting"::"Code Mandatory");

         "Default Dimension".MODIFY(TRUE);

       END ELSE BEGIN

         "Default Dimension".VALIDATE("Value Posting","Default Dimension"."Value Posting"::"Same Code");

         "Default Dimension".MODIFY(TRUE);

       END;

     END;

     }

    END;

    Default Dimension - OnPostDataItem()

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Finding Default Dimension Values - NAV 2009

    Edward,

    The default dimensions can be set on different accounts, customers, vendors.. You can access the default dimension from the card page.

    What is the data item for the above report, it looks like it is setting the value posting to blank or the way it was set on default dimension. Although it is little confusing the else part for me.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans