I would like to warn my fellow Axapta/AX/D365FO bloggers, that blind copy-pasting from each other seems innocent, but it fact may result in spreading bugs.
E.g., the following piece of code is very popular in "How to create Purchase Order from X++" posts.
numberSeq = NumberSeq::newGetNumFromCode(purchParameters::numRefPurchaseOrderId().NumberSequence,true);
Purchtable.PurchId = numberSeq.num();
The problem is numRefPurchaseOrderId returns the number sequence for purchase order confirmation number. For purchase order number, numRefPurchId should have been used. Using the wrong number sequence may result in duplicate key issues.
E.g., the following piece of code is very popular in "How to create Purchase Order from X++" posts.
numberSeq = NumberSeq::newGetNumFromCode(purchParameters::numRefPurchaseOrderId().NumberSequence,true);
Purchtable.PurchId = numberSeq.num();
The problem is numRefPurchaseOrderId returns the number sequence for purchase order confirmation number. For purchase order number, numRefPurchId should have been used. Using the wrong number sequence may result in duplicate key issues.
может, нам завести какой-то тег, типа, "одобрено минздравом"? а то на самом деле, неизвестно, что можно брать, а что нет.
ReplyDelete