Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

NAV 2013 Sales Journal add dimension from batchjob

(0) ShareShare
ReportReport
Posted on by 265

I am new for NAV 2013 and never use NAV before, i am now currently working for doing Data transfer batch from external system to Navision by using Sales Journals and post process. The main tools i use is REPORT C/AL Code for extracting data from a temporary table to Sales Journals.

I got the problem for adding dimension in Sales Journals by the batchjob.

I have tried the following methods, but not successful.

1) Create a table for Dimension Set Entry, insert values directly. (but it fail and show i have no rights for accessing the table)

2) Create a temp table for Dimension Set Entry, insert the necessary information, call Codeunit 408

g_rec_GenJournalLine."Dimension Set ID" := DimMgt.GetDimensionSetID(g_tmp_DimensionSetEntry) ; 

(no effect in the Sales Journal entry)

3) Direct set the Dimension Set ID field in the Sales Journal Table

(no effect in the Sales Journal entry)

Can anyone help me for teaching me the correct method? 

Many thanks.

*This post is locked for comments

  • Suggested answer
    Amol Salvi Profile Picture
    18,694 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Hi

    Check this link

    navseenbyamol.tech.blog/.../dimension-update-in-nav-2016

  • Sathyanarayanan_Cetas Profile Picture
    62 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Hi Mohana,

    Am trying to insert another dimension value in dimension set entry table where

    two dimensions have already been flown to respective order.

    while inserting the record gets inserted, but during commit it gets errored out saying the dimension set id already exists.

    Please advice on this

    thanks

  • Suggested answer
    4BzSoftware Profile Picture
    6,071 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Hi Chan,

    Maybe you got the same problem as one of my customers.

    Try to enter Dimensions for Sales Journal Lines via Windows Client normally:

    - Open Windows Client -> Sales Journal.

    - Input some Transactions and Dimensions that you cannot generate Dimensions.

    - Check Dimensions again.

    Let me know if Dimensions are still there or lost!

  • Suggested answer
    Suresh Kulla Profile Picture
    45,180 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Chan,

    You will get DimVal, by using Dimension code and dimension value code i.e.

    DimVal.GET(DimCode,DimValueCode);

  • Chan Marco Profile Picture
    265 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Hi SURESH KULLA ,

    How can i define DimVal for getting the Dimension Value ID?

    Many thanks for your great help

  • Suggested answer
    Suresh Kulla Profile Picture
    45,180 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Chan,

    since you mentioned you need to create more than one dimension you can do the following to create a Gloabl TempDimSetEntry (i.e. Temporary Record variable for Table 480 Dimension Set Entry)

    TempDimSetEntry.RESET;

    TempDimSetEntry.DELETEALL;

    Create a function to insert dimensions

    CreateTempDimSetEntry(DimCode,DimValueCode) and call this function 8 times for all your dimensions

       TempDimSetEntry.INIT;

       TempDimSetEntry.VALIDATE("Dimension Code",'DimCode);

       TempDimSetEntry.VALIDATE("Dimension Value Code",DimValueCode);

       TempDimSetEntry."Dimension Value ID" := DimVal."Dimension Value ID";

       TempDimSetEntry.INSERT;

    Once you insert all your dimensions in the temporary dimension set entry call the below code which will retrieve the dimension set ID

     GenJournalLine.INIT.

     GenJournalLine."Document No." := 'xxxxx';

     ....

    .....

     GenJournalLine."Dimension Set ID" := DimMgt.GetDimensionSetID(TempDimSetEntry);

      GenJournalLine.INSERT

    If you want to view an example refer to teh

  • Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    Please verify the answers that helped you.

  • Chan Marco Profile Picture
    265 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    g_tmp_DimensionSetEntry is a temporary variable for storing Dimension SetEntry,

    g_rec_GenJournalLine is the record for storing GenJournalLine.

    DimMgt is the codeunit 408

    For creating dimension, can i just use function GetDimensionSetID in Codeunit??

    Thank you

  • Chan Marco Profile Picture
    265 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    I have tried the method 1 "Create Fields in the Gen. Line and then link it with Dimensions" by creating the fields "Shortcut Dimension 3 Code" .

    it works and the dimension value can be displayed in the Gen. Journal Line.

    But, when i go to Dimension Set Entry, only  "Shortcut Dimension 1 Code" and  "Shortcut Dimension 2 Code" value here.

    Due to user will use Dimension Set Entry value for extracting information in Reporting.

    I think i can only use the method 2.

    For method 2, can anyone share the coding on how to checking Dimension Set Entry and

    assign and validate that No. DimensionSetId ?? I think the code i post before is similar to the method 2. Thank you very much.

      g_tmp_DimensionSetEntry.RESET;

      g_tmp_DimensionSetEntry.INIT;

      g_tmp_DimensionSetEntry.VALIDATE("Dimension Code",'2012_AREA_COUNTRY');

      g_tmp_DimensionSetEntry.VALIDATE("Dimension Value Code", 'CANADA');

      g_tmp_DimensionSetEntry.INSERT(TRUE);

      g_rec_GenJournalLine."Dimension Set ID" := DimMgt.GetDimensionSetID(g_tmp_DimensionSetEntry) ;

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: NAV 2013 Sales Journal add dimension from batchjob

    This is just a sample code i tired. In here I used a already available Dimension ID.

    recGenLine.RESET;

    recGenLine.INIT;

    recGenLine."Journal Template Name" := 'General';

    recGenLine."Journal Batch Name" := 'Default';

    recGenLine."Document No." := 'Doc001';

    recGenLine."Dimension Set ID" := 120;

    recGenLine.INSERT;

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

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... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans