My requirement is Production Order ID number sequence has to be generated based on a condition.
If the user specifies the delivery date and sequence number then custom logic has to be applied to generate production ID like (YYYYMMDD-###) Where YYYYMMDD is the user specified delivery date and ### is the 3 digit sequence number .
If the user dint specify the delivery date and sequence number then normal production Order Id number sequence has to be generated .
How to achieve this in AX2012 ?.
It can’t be done by the number sequence framework, therefore you’ll have to handle it in your custom code.
The first case can be done using custom code …How about the second case (If the user dint specify the delivery date and sequence number then normal production Order Id number sequence has to be generated .)??
It already works, therefore you simply won’t use your custom logic in that case. It’s a task for an if/else statement.
I tried the logic using if/else statement .Its working fine in form level based on the specified condition .But when I trying to save the form its throwing an error " Number 20141121-A105 does not match format CEU-######."…please tell me how to proceed with this…
Please tell us what you’ve implemented and where the exception is thrown from.
I have written the code in ProdTableCreate form in ProdTable:Create method.
When I call the ProdTableCreate form from another form where the user specifies the “ItemNumber,DeliveryDate,seqNo” then a custom numsequence is generated like “20141121-A105” and the Custom ProdId gets defaulted in the ProdTableCreate form’s ProdId field. But when I try to fill the Site in the ProdTableCreate form its throwing an error " " Number 20141121-A105 does not match format CEU-######.
You obviously need to adjust the validation as well, but I’m not going to simulate your problem to find where it is. You can easily find it by yourself with the debugger.