Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Change item id to auto generate in product entity in data import export framework

(0) ShareShare
ReportReport
Posted on by 3

Hi,

I am using product and variant entity to release the product with variants. It is working fine. I need to change the item id field as auto generated field. Could you please guide me that how to do this?

Thanks,

Hari

*This post is locked for comments

  • Hariharans87 Profile Picture
    3 on at
    RE: Change item id to auto generate in product entity in data import export framework

    I have marked itemid as auto generated and changed the EDT to EcoResProductNumber. It is working fine.

  • Suggested answer
    ThomasWilke Profile Picture
    760 on at
    RE: Change item id to auto generate in product entity in data import export framework

    To solve that issue we discussed with MS about a possible fix. They suggested the following workaround:

    1. Extend the NumberSeqModuleInventory.loadModule() with the following Code: 
      // Setup product display number for DMFProductEntity
         datatype.parmDatatypeId(extendedtypenum(EcoResProductDisplayProductNumber));
         datatype.parmReferenceHelp("@SYS301183");
         datatype.parmReferenceLabel(literalstr("@SYS133863"));
         datatype.parmWizardIsContinuous(false);
         datatype.parmWizardIsManual(NoYes::No);
         datatype.parmWizardIsChangeDownAllowed(NoYes::No);
         datatype.parmWizardIsChangeUpAllowed(NoYes::No);
         datatype.parmSortField(1);
         datatype.parmWizardHighest(999999);
         datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
         this.create(datatype); 
    2. Change the method from protected to public 
    3. Create a job to call the loadModule method:
      NumberSeqModuleInventory numberSeqModuleInventory = new NumberSeqModuleInventory();
      numberSeqModuleInventory.loadModule(); 

    4. Change the method back to protected 
    5. Go to Inventory and Warehousemanagement Parameters and set the Number Sequence for Product Number. You could use the same Number Sequence as for Item Number or create a new one.
       
  • ThomasWilke Profile Picture
    760 on at
    RE: Change item id to auto generate in product entity in data import export framework

    Hi,

    which version of AX are you using?

    I tried the auto generate for ItemId and displayProductNumber in R3 CU9 and CU10. ItemId is working fine. For displayProductNumber it gives me the error "NumberSequence is not set". Even though the numberSequence is set up correctly in the product Information parameters.

    When debugging the code I can see that AX fails to identify the corresponding NumberSequence for the EDT EcoResProductDisplayProductNumber which is used in the DMFProductEntity. In the NumberSeqModuleEcoResProduct.loadModule() the numberSequnce is assigned to the datatypeId of the EDT EcoResProductNumber.

    I guess that is the problem.

  • Suggested answer
    fatihgork Profile Picture
    3,817 on at
    RE: Change item id to auto generate in product entity in data import export framework

    Hello,

    If all you want is displayproductnumber and itemid to be autogenerated in dmfproductentity, you do not have to write code.

    I can succesfully create products with setting both of them auto generated.

    These two number sequences are defined in product information management and inventory management parameters.

  • Verified answer
    Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Change item id to auto generate in product entity in data import export framework

    well, here you can see a sample post for customization of DIXF/DMF

    In actual practice, it depends upon situation, where we need to write code and what we need to write.

    For your case, as you want Auto ItemId, so you should write your logic somewhere, where ItemId is initiated, or you can replace current logic which is considering to accept ItemId from import file. Instead of that you may write a new generate method for your field, this newly added method can contain the logic to get itemId from anywhere (as per your business requirement)

  • Hariharans87 Profile Picture
    3 on at
    RE: Change item id to auto generate in product entity in data import export framework

    Hi Sohaib,

    Could you please give me some sample code?

    Thanks,

    Hari

  • ThomasWilke Profile Picture
    760 on at
    RE: Change item id to auto generate in product entity in data import export framework

    Hi,

    setting itemId to auto generate works fine for me, but when i set  displayProductNumber to auto I get the message that the "Number sequence is not set". Can you confimr that auto generate is working in your Environment for the displayProductNumber.

    I've tested it in R3 CU9 and CU10.

  • Verified answer
    fatihgork Profile Picture
    3,817 on at
    RE: Change item id to auto generate in product entity in data import export framework

    Hi Hariharans87,

    If you hit "modify target mapping" button in your entities form in processing group, you will see the "mapping details button" in that form.

    Find ItemId and Display Product Number fields, and just set "auto generated" check box for those.

  • Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Change item id to auto generate in product entity in data import export framework

    you have to customize your DMF entity.

    lets suppose if you are using DMFProductEnitity, 1st of all make itemId non-mandatory from table DMFProductEntity. secondly make changes in following method to get ItemId based on any logic, so the itemid can be utilized in Release process of product

    \Classes\DMFProductEntityClass\insertUpdate

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans