Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

is there any DIXF entity to load Pending/Active Cost price AX 2012 R2

Posted on by 415

Hi, 

Is there any DIXF Entity to load Pending/Active cost price in AX 2012 R2. 

Product Information management > Released products > Manage cost tab on top > Item Price. 

I had many items and dimensions. Prices vary based on dimensions too. So I need a DIXF entity to load all those. So do we have any standard DIXF Entity?  AX 2012 R2

If not, any suggestions how to load?

*This post is locked for comments

  • DynamicsAXExplorer Profile Picture
    DynamicsAXExplorer 415 on at
    RE: is there any DIXF entity to load Pending/Active Cost price AX 2012 R2

    Yes Using above code we can load StandardCost price. Yes the above answered can be verified.

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: is there any DIXF entity to load Pending/Active Cost price AX 2012 R2

    Hello DynamicsAXExplorer,

    It looks as if you have fixed your problem by the code mentioned.

    Is that right and is your question thereby answered or is there still some information that you need from the community?

    Best regards,

    Ludwig

  • Verified answer
    DynamicsAXExplorer Profile Picture
    DynamicsAXExplorer 415 on at
    RE: is there any DIXF entity to load Pending/Active Cost price AX 2012 R2

    Used this job to load StandardCostPrice into AX 2012 R2

    static void StandardCostPriceImportJob(Args _args)

    {

        InventItemPriceSim    priceSim;

       InventDim             invDim;

       FileIOPermission  permission;

       boolean first = true;

       CommaIo        commaIo;

       FileName       fileName = "\\\\Servername\\folder\\subfolder\\Filename.csv";

       container      readCon;

       int            i;

       str            itemNum, costingType, priceType, versionId, site, price, priceUnit, priceCharges,priceQty,IncInUnitPrice,unitId, activateDate;

       str            color, style, size, configuration;

       CostingVersionPriceType   costVersionPriceType;

       permission = new FileIOPermission (fileName, 'r');

       permission.assert();

       commaIo = new CommaIo(fileName, 'r');

       commaIo.inFieldDelimiter(',');

       ttsBegin;

       if(commaIo)

       {

           while(commaIo.status() == IO_Status::Ok)

           {

               readCon   = commaIo.read();

               if (readCon)

               {

               if (first)  //To skip header

               {

               first = false;

               }

               else

               {

       //File should contain fields in below sequence

               itemNum          = conPeek(readCon, 1);

               costingType      = conPeek(readCon, 2);

               priceType        = conPeek(readCon, 3);

               versionId        = conPeek(readCon, 4);

               site             = conPeek(readCon, 5);

               price            = conPeek(readCon, 6);

               priceUnit        = conPeek(readCon, 7);

               priceCharges     = conPeek(readCon, 8);

               priceQty         = conPeek(readCon, 9);

               IncInUnitPrice   = conPeek(readCon, 10);

               unitId           = conPeek(readCon, 11);

               activateDate     = conPeek(readCon, 12);

               color            = conPeek(readCon, 13);

               style            = conPeek(readCon, 14);

               size             = conPeek(readCon, 15);

               configuration    = conPeek(readCon, 16);

               invDim.InventSiteId = site;

               invDim.InventColorId = color;

               invDim.InventStyleId = style;

               invDim.InventSizeId  = size;

               invDim.configId      = Configuration;

               invDim = InventDim::findOrCreate(invDim);

               if(InventTable::find(itemNum))

               {

                   if(!InventItemPriceSim::find(itemNum,versionId,str2Date(activateDate,123),str2enum(costVersionPriceType,priceType),invDim.inventDimId))

                   {

                       priceSim.clear();

                       priceSim.ItemId        = itemNum;

                       priceSim.PriceType     = str2enum(costVersionPriceType,priceType);

                       priceSim.VersionId     = versionId;

                       priceSim.Price         = str2num(price);

                       priceSim.PriceUnit     = str2int(priceUnit);

                       priceSim.UnitID        = unitId;

                       priceSim.PriceQty      = str2num(priceQty);

                       priceSim.InventDimId   = invDim.InventDimId;

                       priceSim.PriceAllocateMarkup = NoYes::Yes;

                       priceSim.FromDate      = str2Date(activateDate, 123);

                       priceSim.insert();

                       i++;

                       info(strFmt("Imported std cost is %1", itemNum));

                   }

               }

                   }

               }

           }

           info(strFmt("total number of std imported is %1", i));

       }

       ttsCommit;

    }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans