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

Announcements

No record found.

News and Announcements icon
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 69

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

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 2 on at

    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

  • Verified answer
    fatihgork Profile Picture
    3,817 on at

    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.

  • ThomasWilke Profile Picture
    766 on at

    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.

  • Hariharans87 Profile Picture
    69 on at

    Hi Sohaib,

    Could you please give me some sample code?

    Thanks,

    Hari

  • Verified answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 2 on at

    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)

  • Suggested answer
    fatihgork Profile Picture
    3,817 on at

    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.

  • ThomasWilke Profile Picture
    766 on at

    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
    ThomasWilke Profile Picture
    766 on at

    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.
       
  • Hariharans87 Profile Picture
    69 on at

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans