Notifications
Announcements
No record found.
Hi,
when we post product receipt, we must input product receipt number manually. does AX have some setup to make it automatically filled using number sequence?
thanks in advance
*This post is locked for comments
Hi blueberrycheesecake,
This is out of the box not possible. Usually you need to enter the product receipt as mentioned on the delivery note from the vendor.
In some cases you would be indeed in the need for a number sequence here. We had the same on another project. In that case you can customize it. Create a new number sequence reference and have this field populated from the new number sequence.
There's an Enterprise Portal form that lets you do a Product Receipt and doesn't ask you for a Product Receipt number - but takes it from a number sequence.
Hi Andrea,
Could elaborate more on how to achieve this? Creating a new sequence is understood. But where should I customize the population of sequence number in the field (Code wise).
Also as a business case if a user opens product receipt form and the customization pulls a new sequence number, then the user cancels the product receipt so in this case I will loose a sequence number. Th eorder of the product receipts will be inconsistent.
I had same requirement few months back and I did it.Please refer to below thread:
community.dynamics.com/.../658664
Please let me know if it helps you , otherwise i will tell you in more details with code snapshot.
Hi Visvash,
Thank you for your prompt response..
Form what I understad you have created a dynamic solution by customizing in payable parameters etc.. This part I have no idea how to implement so any help is appreciated.
Now for the customization on the product receipt form is quite clear, the additional methods in PurchEditLinesForm and overriding then in _packingSlip class. But the last part is not very clear. Which code did you shift to PurchPackingSlipJournalCreate to solve the sequence coming in new line issue?
If possible could you share the entire solution, so I could better understand. Also does your sequence maintain order in case product receipts were cancelled after taking a sequence number?
Murtaza,
1st Step:- Create Number Seq for Product Receipt
1. write code in loadmodule() of NumberSeqModulePurchaseOrder class for ProductReceiptID.
2. Write a method on PurchParameters table to get NumberSeqReference
3. Create a job to load Number Sequence that were not generated.
4. Generate the Number Seq for product Receipt from Organization Administration > Number Sequences > Generate (through Wizard).
2nd Step:- Populate Number Seq for Product Receipt
I have generated Product Receipt Number Seq after posting Product receipt so it doesn't need to maintain Number Seq if product receipt got cancelled.
1. First Product Receipt field is editable on form so you need to make it uneditable. So go to Classes > PurchEditLinesForm_PackingSlip and locate method "numAllowEdit" and return it false.
2. Now populate the Number Seq for ProductReceiptId in "PurchPackingSlipJournalCreate" class. You need to do same as they generate for packingSlip Number and voucher ( allocateNumAndVocuher() and getNumAndVoucher() ) . In your case write allocateProductReceiptId() and getProductReceiptId() method.3. Then you have to change the code in initHeader() to initialize the ProductReceiptId :
vendPackingSlipJour.PackingSlipId = purchParmTable.getProductReceiptId() // getproductReceiptId() method for getting the number seq of ProductReceiptId in
Sorry , I can't able to paste the code here right now because my server is shut down for some time, once I'll log on my server I will paste all code. Meanwhile you can try this.
I followed your steps but I'm stuck in the reference between ProductReceiptId and the number sequence I created, so I wish if you could share the entire solution.
Regards.
Hi Ahmed,
I am assuming you are created ProductReceiptId Number Seq. successfully so now need to generate ProductReceiptId after Posting ProductReceipt. So here is entire solution:
1. Locate PurchEditLinesForm_PackingSlip class and open numAllowEdit() method and chnage like below:
public boolean numAllowEdit() { /* boolean ret; ret = super() && !purchFormLetter.proforma(); return ret;*/ return false; // allow user not to enter manually product receipt number }
2. Locate PurchPackingSlipJournalCreate class and create following methods:
Protected NumberSequenceReference numberSeqReferenceProductReceipt() { // create a numberseq for ProductReceiptId return PurchParameters::numRefProductReceiptId(); }
protected numberSeq allocateProductReceiptNum() { NumberSeq localNumberSeq; NumberSequenceReference localNumberSeqReferenceNum = this.numberSeqReferenceProductReceipt(); ; if(localNumberSeqReferenceNum) { localNumberSeq = NumberSeq::newGetNum(localNumberSeqReferenceNum); } return localNumberSeq; }
Protected num getProductReceipt() { // create NumberSeq for ProductReceiptID ; if(!this.proforma()) { numberSeq = this.allocateProductReceiptNum(); if(NumberSeq) { ProductReceipt = NumberSeq.num(); } } return ProductReceipt; }
3. change the initHeader() method of this class to initialize your number seq.
public void initHeader() { #ISOCountryRegionCodesEuro_W vendPackingSlipJour.clear(); vendPackingSlipJour.initValue(); // vendPackingSlipJour.PackingSlipId = purchParmTable.Num; // comment this line vendPackingSlipJour.PackingSlipId = this.getProductReceipt(); //generate Number Seq for Product Receipt .... rest of code remains same
Hope this helps you.
Hi Vishvash,
I did as you mentioned above, however the form is prompting me to enter a product receipt number and not allowing me to post the product receipt.
no standard function do that
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2