Get Dimension Set ID from a Gen. Journal Line

RoelofRoelof Member Posts: 377
edited 2015-10-01 in NAV Three Tier
I'm trying to get (calculate) a Dimension Set ID for a Gen. Journal Line with Shortcut Dimension 1 Code and Shortcut Dimension 2 Code populated but with an unknown Dimension Set ID. How can I calculate the Dimension Set ID based on the 2 shortcut dimension codes? Is there a function in the Dimension Mgt CU doing that. I was looking into some functions but couldn't determine which function would work.

Thanks
Roelof de Jonghttp://www.wye.com

Comments

  • postsauravpostsaurav Member Posts: 708
    Hi,

    Did you changed anything because in standard Product as soon you enter values for Global / Shortcut Dimension system returns you a Dimension Set ID as per combination.

    If you inserting line via code i would suggest to call Validate of the Shortcut Dimension Code Fields.

    If you are still looking for a function, here you go -
    In Codeunit DimensionManagement, Function to Get Dimension SET ID is - GetDimensionSetID.

    It accepts a Record of Dimension Set Entry Table. Try Inserting Value in Dimension Set Entry Table Variable But Make sure the variable is Temporary.

    Once you fill your both values in Dimension Set Entry Table Variable, call this function and it will return you dimension set ID.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • geordiegeordie Member Posts: 655
    You need to use ValidateShortcutDimValues function of DimensionManagement codeunit.
  • krikikriki Member, Moderator Posts: 9,112
    [Merged posts from topic ]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • RoelofRoelof Member Posts: 377
    Saurav,
    No, I haven't changed anything. The Dimensions are populated from a set up. So, when the Gen. Journal Line is populated, the dimensions are not coming from a default table (customer, et..) to get the dimensions (and Dimension Set ID) but from a setup table (which doesn't have a Dimension Set ID). So I'm forced to calculate the Dimension Set ID field based on the dimensions coming from the setup.

    Geordie,
    Yes, that looks like the function I need to use.
    Any concern with the 'FieldNumber' parameter? Because it looks like you can do it only one dimension at the time. So, in order to get the correct Dimension Set ID for both dimensions (1 and 2) you need to run it for both dimensions and the second time it would give the correct Dimension Set ID? (that is what it looks like).

    Thanks.
    Roelof de Jonghttp://www.wye.com
  • postsauravpostsaurav Member Posts: 708
    Hi,

    Is your Issue Resolved or you still need any help.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • geordiegeordie Member Posts: 655
    Roelof wrote:
    Geordie,
    Yes, that looks like the function I need to use.
    Any concern with the 'FieldNumber' parameter? Because it looks like you can do it only one dimension at the time. So, in order to get the correct Dimension Set ID for both dimensions (1 and 2) you need to run it for both dimensions and the second time it would give the correct Dimension Set ID? (that is what it looks like).

    Thanks.

    Yes, correct.
    If you check the code in the Gen. Journal Line table you will notice that this function is called in both the validation of fields Shortcut Dimension 1 Code and Shortcut Dimension 2 Code.
    After the second validation (so after the second call) the proper Dimension Set ID is retrieved.
  • chengadachengada Member Posts: 1
    Hi All,

    is anyone can share your object for Get Dimension ID when import transaction through XML port for Flat file.

    Regards
    Ada S C Cheng
Sign In or Register to comment.