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 AX (Archived)

Setup a new unit of measure conversion X++

(0) ShareShare
ReportReport
Posted on by

I'm attempting to write a job to setup a number of unit of measure conversion based on information from a CSV file.

I've created an instance of UnitOfMeasureUnitConversion and added UnitOfMeasureUnitConversion_Conv to it to as a new conv but I'm not sure what service I would use to release this to the database. Can anyone help?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    After looking into it I have found services to use, delete or edit unit conversions in near every way but not one that allows you to insert conversions in the way you can with products.. Anyone have any ideas?

    I've had similar problems with the prices and costs of products. There's a service in place to activate prices but not add them to the tables.

    Neither of which is a terribly serious problem as both can be solves simply by inserting data directly into the tables but I've been trying to avoid this I'm always unsure if additional tables need to be updated for the program to function correctly. Does anyone know if diagrams of the table structures and relations are available for AX 2012?

  • Abdel Fatah Ahmed Profile Picture
    on at

    hi Dan Griffiths look at my blog you will find some code lines it will helping you to create unit of conversion and also you will find how to read the data from excel sheet

    i hope that what you want

    dynamics-abdelfatah-elminisy.blogspot.com

    Best regards,

  • Community Member Profile Picture
    on at

    Thanks Abdel, but that seems to be a 2009 solution and I'm working with 2012. No worries though I've solved the problem now.

  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at
  • Suggested answer
    Ivan (Vanya) Kashperuk Profile Picture
    on at

    Hmm.

    The below code should be sufficient to create a conversion. not sure why you are trying to do more:

        UnitOfMeasureConversion unitOfMeasureConversion;
    
        unitOfMeasureConversion.FromUnitOfMeasure   = _fromUnitOfMeasure;
        unitOfMeasureConversion.ToUnitOfMeasure     = _toUnitOfMeasure;
        unitOfMeasureConversion.Product             = _product;
        unitOfMeasureConversion.Factor              = _factor;
        unitOfMeasureConversion.Numerator           = _numerator;
        unitOfMeasureConversion.Denominator         = _denominator;
        unitOfMeasureConversion.InnerOffset         = _innerOffset;
        unitOfMeasureConversion.OuterOffset         = _outerOffset;
        unitOfMeasureConversion.Rounding            = _rounding;
        unitOfMeasureConversion.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

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans