Create Dimension set id for the combination of three 'Dimension code': Dept,Project and Channel.

ManiNavManiNav Member Posts: 120
Hi Everyone,(Nav-2018)

I would like to create 'Dimension set id' for the combination of three 'Dimension code': Dept,Project and Channel in "Dimension set entry" table. for this i am following the below link:
https://dynamicsuser.net/nav/b/amol/posts/dimension-update-in-nav-2016

For this: Step:1. I have created one variable for record "Dimension set entry" with property temporary=yes,as they told.
Step:2. I am not able to get that how can i add all above three dimension code combination:Dept,Project and Channel by cal/code. and further to call GetDimensionId of codeunit:DimensionManagement.

Please guide me.

Thanks,
Mani.

Answers

  • ManiNavManiNav Member Posts: 120
    Hi everyone,

    Please guide me for the above query.

    Thanks,
    Mani.
  • KTA8KTA8 Member Posts: 398
    You should create a temporary dimension set entry something like this:


    DimSetEntry.INIT;
    DimSetEntry."Dimension Set ID":=-1;
    DimSetEntry."Dimension Code":=lt_DimSetEntry."Dimension Code";
    DimSetEntry."Dimension Value Code":=lt_DimSetEntry."Dimension Value Code";
    DimSetEntry."Dimension Value ID":=lt_DimSetEntry."Dimension Value ID";
    DimSetEntry."Dimension Name":=lt_DimSetEntry."Dimension Name";
    DimSetEntry."Dimension Value Name":=lt_DimSetEntry."Dimension Value Name";
    DimSetEntry.INSERT(FALSE);

    Using this function, you will get the id
    GetDimensionSetID(recDimSetEntry)
  • ManiNavManiNav Member Posts: 120
    Hi KTA8,

    Thank you so much for your reply.
    Here I am not able to get, where you add my required three 'Dimension code': Dept,Project and Channel. and for which record you are using lt_DimSetEntry.

    Please tell me. your will be appreciable.

    Thanks,
    Mani.
  • PhoguePhogue Member Posts: 76
    edited 2019-12-16
    Each of your dimensions is inserted as a Record of Dimension Set Entry, using the following block from KTA8:
    DimSetEntry.INIT;
    DimSetEntry."Dimension Set ID":=-1;
    DimSetEntry."Dimension Code":=lt_DimSetEntry."Dimension Code"; //This is your three codes: project, dept & channel
    DimSetEntry."Dimension Value Code":=lt_DimSetEntry."Dimension Value Code"; //This is the value from your dimension codes
    DimSetEntry."Dimension Value ID":=lt_DimSetEntry."Dimension Value ID";
    DimSetEntry."Dimension Name":=lt_DimSetEntry."Dimension Name";
    DimSetEntry."Dimension Value Name":=lt_DimSetEntry."Dimension Value Name";
    DimSetEntry.INSERT(FALSE);
    

    Then, once you've inserted all 3, you pass it as a parameter to the GetDimensionSetID Function, which is in the Dimension Set Entry table.
  • ManiNavManiNav Member Posts: 120
    Hi KTA8/Phogue,

    below code is not working as i need.

    DimSetEntry.INIT;
    DimSetEntry."Dimension Set ID":=-1;
    DimSetEntry."Dimension Code":=lt_DimSetEntry."Dimension Code"; //This is your three codes: project, dept & channel
    DimSetEntry."Dimension Value Code":=lt_DimSetEntry."Dimension Value Code"; //This is the value from your dimension codes
    DimSetEntry."Dimension Value ID":=lt_DimSetEntry."Dimension Value ID";
    DimSetEntry."Dimension Name":=lt_DimSetEntry."Dimension Name";
    DimSetEntry."Dimension Value Name":=lt_DimSetEntry."Dimension Value Name";
    DimSetEntry.INSERT(FALSE);

    I am not able to get your whole code:
    1.DimSetEntry."Dimension Set ID":=-1;
    ---> why you assign to -1,what it will do?
    2.DimSetEntry."Dimension Code":=lt_DimSetEntry."Dimension Code"; //This is your three codes: project, dept & channel
    ---> here, for which record you are using 'lt_DimSetEntry', is it variable for 'Dimension set entry'? I am using 'DimSetEntry' with property-Temporary = Yes.

    so, please tell me in details, because i am not getting how it will generate Dimension set id for my given three Dimension code combination: Dept, channel and project.

    Plese guide me,

    Thanks,
    Mani.
  • ManiNavManiNav Member Posts: 120
    Hi KTA8/Phogue,

    Actually i am creating purchase invoice to take the value from one table, where i have three dimension code combination, but for this i need to update one dimension set id for all dimension code. For this I need to create dimension set id.

    Please help me further.

    Thanks,
    Mani.
Sign In or Register to comment.