web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to add custom dimension value to Dimension Set Entry?

(0) ShareShare
ReportReport
Posted on by 172

Hello. I am trying to resolve an issue for two days. I have to add a custom dimension to dimension set on Sales Order. Here is the case:

I am creating the sales order from CRM sales order. Creating SO in NAV, values of the standard dimensions (Responsibility Center, Customer, Salesperson, Campaign and Customer Template) are copied to the dimension set and assigned to SO. Now I need to add to this custom CRM_ORDERNO set. Of course, I have created the dimension value earlier.

Reading some articles in the Internet I managed to get to the stage with this code:

// TempDimEntrySet : TEMPORARY Record [Dimension Set Entry]

TempDimEntrySet.INIT; TempDimEntrySet.VALIDATE("Dimeniosn Set ID", SalesHeader."Dimension Set ID"); TempDimEntrySet.VALIDATE("Dimension Code", 'CRM_SALESORDER'); // opentext value for better understood TempDimEntrySet.VALIDATE("Dimension Value Code", 'ORD-1234-XYZ'); // opentext value for better understood TempDimEntrySet.INSERT(TRUE); NewSetID := DimMgt.GetDimensionSetID(TempDimEntrySet); SalesHeader."Dimension Set ID" := NewSetID; SalesHeader.MODIFY;

The effect is that I have a new Dimension Set with ONE dimension CRM_SALESORDER. Now, what shoud I do to put all dimension values (standard and mine) in one SET?

Best regards!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Andrey Baludin Profile Picture
    3,941 on at

    Hi! You forgot to get sales header dimension set. Try next:

        vars:
            DimMgt : Codeunit DimensionManagement;
            TempDimSetEntry : Record "Dimension Set Entry" temporary;

    Code:


            DimMgt.GetDimensionSet(TempDimSetEntry, SalesHeader."Dimension Set ID");
            TempDimSetEntry.Init;
            TempDimSetEntry.VALIDATE("Dimension Code", 'CRM_SALESORDER');
            TempDimSetEntry.VALIDATE("Dimension Value Code",'ORD-1234-XYZ');
            if not TempDimSetEntry.INSERT then
                TempDimSetEntry.Modify;
            SalesHeader.Validate("Dimension Set ID", DimMgt.GetDimensionSetID(TempDimSetEntry));

     SalesHeader.MODIFY;  

  • Verified answer
    Community Member Profile Picture
    on at

    check this navnab.com/.../how-to-calculate-dimension-set-id

  • MateuszKILINSKI Profile Picture
    172 on at

    Thanks guys. Your solutions are great!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans