How to create a Number Sequence for Sales Packing slip & Invoice for warehouse wise in AX 2012.

Hi Every one,

I created 2 fields in InventLocation Table with EDT Numbersequencecode.

Added in the form… Inventory Management >>Setup>> InvetoryBreakdown>>Warehouses tab >> In new tab 1.sales packing slip no 2.Sales invoice no

Then I created Number sequence for some warehouses manually by right click on field >>view details page… for both sales Packing slip no and Sales Invoice no field.

Now I want number sequence for packing slip and invoice no for posting Sales order if I select that particular warehouse in header which I created number sequence manually.

I know that I need to write code in Salespackingslipjournalcreate and salesinvoicejournalcreate classes. But I am unable to write the code…

Please help me…

Thanks to all…

The default logic determining number sequences is located in SalesInvoiceJournalCreateBase,allocateNumAndVoucher() and SalesPackingSlipJournalCreate.allocateNumAndVoucher().

Hi Martin,

Thanks for reply

can you tell me how to write code for Packing slip and invoice…

What’s the part you need a help with?

You have to find the warehouse for the order header - that’s in salesTable.InventLocationId. Then you have to take a value from your field. You have to decide what to do if it’s empty. Then use the value at appropriate places in those methods (depending on your requirements regarding priority of this selection logic).

Hi Rajesh,

Number sequence related queries were discussed so many times in this forum. Please take the initiate and search for them.