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)

How can I create inventDim by code

(0) ShareShare
ReportReport
Posted on by

Hello,

I have to create inventdim by code in a job.

But, systematicaly, AX send an error : "the inventDimId already exists" but this inventdimid don't exist.

What I have to do ?

When I use the standard methode "findorcreate", dynamics send me invendim where inventdimId is "Allblank". but I don't want the allblank.

 

Can you please help me ?

 

Thanks by advance.

*This post is locked for comments

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

    Hi,

    Me, I use the following code in a job (becarefull, it depends of stock dimensions) :

                           inventDimConfig.clear();

                           inventDimConfig.wMSLocationId    = _wMSLocationId;

                           inventDimConfig.InventLocationId  = _InventLocationId;

                           inventDimConfig.configId                 = _StandardConfigId;

                           inventDimConfig.wMSPalletId         = _wMSPalletId;

                           inventDimConfig = InventDim::findOrCreate(inventDimConfig);

    Best regards

  • Suggested answer
    Dhruv R Thakar Profile Picture
    214 on at

    Recently i came across a requirement, where i  need to create or find Invent Dim records by passing item attributes. You can check below link for the same type of requirement.

    [View:https://dhruvrthakar.blogspot.com/2018/04/create-or-find-invent-dim-in-ax-2012.html:750:50]

    If the post is helpful in that it provides the solution, please mark as verified to help other members...

  • Noob_Man Profile Picture
    10 on at

    InventDim inventDim

    PurchLine _purchLine

    //then write below

    inventDim.inventSiteId = "MainSite";

    inventDim.inventLocationId = "Main_WH";

    inventDim.inventSerialId = "random_value";

    inventDim.inventDimId = inventDim::FindOrCreate(inventDim).inventDimId;

    // then from your excel while importing values from file into PO lines i.e. purchline

    Select for update _purchLine

    ttsbegin;

    _purchLine.InventDimId = inventDim.inventDimId;

    _purchLine.insert();

    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

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