"Number sequence ends with the year" option PR0021/13

Hi All,

I believe that many clients will request to have the number sequence to represent the year in which the document is created.

I dont think that this is not available even in latest version of AX2012 R2.

say my purchase requisitions sequence should be PR0021/13 (/13 is the year code), when it comes to the next year it should be like PR0089/14" to make it easy to identify in which year that it is raised.

Any specific reason?

Could anyone express your views on this Pls

I wrote my opinion about that in this forum last Friday (link). To summarize that, I think it’s completely possible - you can use number sequence scope to define which number sequence should be used which year.

Hi Martin,

Thanks for your reply, I’ve gone through the post. By chance, have you tried achieving this through the scope “Legal entity and fiscal calendar period”?

I tried it but it didnt work out for me. when I select this scope as “legal entity and fiscal calendar period” we wont get the needed references.

Let’s say we want this for AP>Purchase orders, We can’t get this reference when we select that scope.

I Appreciate your response because finding solution for this will be helpful for many client implementations [:)]

You can’t use that in that specific case for two reasons:

  1. Number sequence for PurchId data type is not set to include parameter for a fiscal period (refer to NumberSeqModulePurchaseOrder.loadModule()).
  2. Purchase orders use a single number sequence ID configured in parameters, not the new approach (= references). For example, look at PurchAutoCreate.setPurchTable() - it calls NumberSeq::newGetNum(PurchParameters::numRefPurchId()), i.e. it passes a concrete sequence ID and no scope. It would have to use newGetNumFromCode() and pass appropriate scope as the second parameter to work as you want.

You surely can change AX to support fiscal periods for purchase orders, nevertheless all scopes aren’t automatically supported for all types.

Is there any MS document available to know that which scopes are automatically support for all types ?

Seems to be Number sequence is a half - baked functionality in AX 2012.

Hey Lally,

See “Segment configuration” form under Organization administration>Number sequences. It will tell you which type supports which scope.

For instance, AP> Invoice vocher> shows you the segment “Company”, so only a number sequence of “Company” will be supported by this type.

I disagree with the above. What made you to think it’s half baked…having the year id at the end of number sequence is customization which is not covered with standard AX2012.

MS had given the option " Legal entity and fiscal calendar period" , but it is not possible to use this option for Purchase orders , sales orders and journals .

When MS had given the standard option " Legal entity and fiscal calendar period" , why again need to go for customization ?

who said MS has given this “Legal entity and fiscal calendar period” for Purchase orders. That meant for country specific requirements which will not useful for our scenario.

I didnt find any document reference which tells us to use the particular scope for “number sequence with calendar year ending”.

So, It’s customization finally.

Hi Santosh,

I have the same requirement,like i need the sequence based on the year which is posted, so can you please help me if u got the solution for that…

Many Thanks

No Rajendra, It can’t be achieved with Standard AX2012. you must go for customization.

Hi Santosh,

i do create a new number sequence from code then also am not getting that sequence…there is no method for prefixing the sysdate for the new sequence…

kindly please help me on this…

Thanks in Advance .

First, you need to create a scope. For fiscal calender periods, you can use NumberSeqScopeFactory::createLegalEntityFiscalCalendarPeriod(), for instance. Then pass the scope to a method that accepts that, e.g. NumberSeq::newGetNumFromCode().

Hi Martin,

But in the scope i can’t get the fiscal period even i defined the year,period…i didn’t get in scope…so how can i define scope for the fiscal calender.

after i get in the scope only i can catch that scope in the code…but over here scope is empty…even i select the year and period…

One more Q… if i didn’t define any scope in the number sequence from the code how can i get the current year as the prefix or post fix for the number sequence…

Thanks in Advance…