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.
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.
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.
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?
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.
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.
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.
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?
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156