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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to Add a Product to Procurement Categories via x++ code

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have a list of Products to be added to procure categories via x++ code.

How could I do this ? is it possible to add via x++ code ?

regards,

MAnia

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Srini Ramidi Profile Picture
    2 on at
    RE: How to Add a Product to Procurement Categories via x++ code

    Hello,

    It's pretty straight forward, look at the method   "selectProduct" in EcoResCategoryAddProduct form. You need find Category,CategoryHierarchy(EcoResCategory table) and Product(EcoResProduct) Record Id's and insert into

    EcoResProductCategory table.

  • Suggested answer
    Pradeep Itnal Profile Picture
    3,248 on at
    RE: How to Add a Product to Procurement Categories via x++ code

    can you elaborate your question. try below first  is this what u want to achieve

    EcoResProductCategory           ecoResProductCategoryToCreate;

    ecoResProductCategoryToCreate.initValue();

               ecoResProductCategoryToCreate.Category =   ecoResCategory.RecId;(Should be passed as a parameter of type recid)

               ecoResProductCategoryToCreate.CategoryHierarchy = ecoResCategory.CategoryHierarchy; (Should be passed as a parameter of type recid)

               ecoResProductCategoryToCreate.Product = ecoResProduct.RecId; (your product recid)

               ecoResProductCategoryToCreate.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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans