Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

(0) ShareShare
ReportReport
Posted on by

Hi, 

Our project requires to have an auto filled number sequence upon clicking new in item creation, so we generated number sequence code, and we were not able to auto populate the generated number sequence code in the product number field of EcoResProductCreate Form considering that the form has no DataSource on it. 

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    The difference between those two approach isn't in the format; it's in what numbers you'll get.

    But I guess you really want two separate number sequence, therefore I would focus on numberSeqProduct() method mentioned before. You can use CoC to extend the method and configure NumberSeqStringControlHelper with a different number sequence.

  • Patrick G. Profile Picture
    Patrick G. on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    Yup, the format of number sequence should be A-#### for Item A and B-##### for Item B.

    Now whenever Item A is to be created, A-##### should automatically assign in the product number field, and creating item B, number sequence B-##### should be used.

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    Moved from Dynamics AX Forum.

    Do I understand correctly that you want to get the number from the standard number sequence (e.g. you'll get 12345) and merely add a prefix (the result will be something like MY12345)? Or do you actually use two different number sequences?

  • Patrick G. Profile Picture
    Patrick G. on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    I'm sorry for my confusing reply. Dynamics 365 is what I'm using and I'm developing in Visual Studios 2017.

    Product number is what I'm really talking about, and the goal is to automatically assign number sequence with specific prefixes for 2 different items, so I created 2 different number sequence prefixes in line with the 2 items. 

    The only problem is to automatically assign those number sequence into the product number field of EcoResProductCreate Form seen in the picture below.

    7607.MicrosoftTeams_2D00_image-_2800_1_2900_.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    You were talking about product number, but now you mentioned an item number. Which of these two do you actually want?

    If your goal is only adding a prefix, maybe you don't need to generate the number by yourself. You could let the system generate a number in the usual way and you'll simply add the prefix.

    If you want to use a different number sequence, you also don't need to do everything again. You could just tell the system to use a different one. For example, the number sequence for product numbers is set up in numberSeqProduct(). It takes the value from EcoResParameters, but you could do it differently in your case.

    There is no AX 2017. The last version of Dynamics AX is AX 2012 R3.

  • Patrick G. Profile Picture
    Patrick G. on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    The version of AX is 2017.

    What code can set the values for EcoResProductCreate Form, specifically to an item number without DataSource?

    The standard logic does not work because I have special requirements in which a specific number sequence prefix is to be used for certain items.

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: How to auto populate the product number field in item creation (EcoResProductCreate Form) with the generated number sequence code?

    Getting product numbers from a number sequence is standard logic. Are you saying that you failed to configure it, or that the standard logic doesn't work for you, because you have some special requirements?

    By the way, what is your version of AX?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans