You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Posted sales invoice that is being used to create a Credit Memo.
I have other tables where I wish to record the fact that the Credit memo has been created.
These tables may have several records for each sales invoice line and I need to relate these lines to the corresponding line or lines in the Credit memo.
For the trivial case the Sales line line numbers may match the credit memo but not generally.
Currently I have several inserts in the codeunit that record the line numbers used when the sales invoice lines are copied to the temp table. For other locations in the codeunit I forbid (TESTFIELD) copying of sales invoice lines that are related to my additional tables. When the credit memo lines are actually created I use the temp table line numbers to link the created credit memo lines to the posted sales invoice lines that they came from.
The standard code seems to overload the "Shipment No." and "Return Receipt Line No." fields to store this information "sometimes" eg: FromSalesInvLine.GET("Shipment No.","Return Receipt Line No.");, but the fields appear to be cleared by the time the "OnBeforeInsertToSalesLine" and "OnAfterInsertToSalesLine" (v13.0.22490) triggers are called.
My preference would be for a temp "Line Number Buffer" with all the relationships to be provided on the InsertToSalesLine triggers so I can make simple (eg: is it one-to-one) or complex (eg: pick a line if they're "compatible") decisions on how to handle the various possibilities. NB: Without all the detail I probably won't be able to trap all the error states to give reasonable errors.
The text was updated successfully, but these errors were encountered:
Sounds like you are requesting an improved linking between Sales Invoices and Credit Memos. Could you post that idea to http://aka.ms/bcideas with all necessary details? Sounds like all BC users could benefit from that improvement, rather than enabling extensibility for you to solve this.
I have a Posted sales invoice that is being used to create a Credit Memo.
I have other tables where I wish to record the fact that the Credit memo has been created.
These tables may have several records for each sales invoice line and I need to relate these lines to the corresponding line or lines in the Credit memo.
For the trivial case the Sales line line numbers may match the credit memo but not generally.
Currently I have several inserts in the codeunit that record the line numbers used when the sales invoice lines are copied to the temp table. For other locations in the codeunit I forbid (TESTFIELD) copying of sales invoice lines that are related to my additional tables. When the credit memo lines are actually created I use the temp table line numbers to link the created credit memo lines to the posted sales invoice lines that they came from.
The standard code seems to overload the "Shipment No." and "Return Receipt Line No." fields to store this information "sometimes" eg:
FromSalesInvLine.GET("Shipment No.","Return Receipt Line No.");
, but the fields appear to be cleared by the time the "OnBeforeInsertToSalesLine" and "OnAfterInsertToSalesLine" (v13.0.22490) triggers are called.My preference would be for a temp "Line Number Buffer" with all the relationships to be provided on the InsertToSalesLine triggers so I can make simple (eg: is it one-to-one) or complex (eg: pick a line if they're "compatible") decisions on how to handle the various possibilities. NB: Without all the detail I probably won't be able to trap all the error states to give reasonable errors.
The text was updated successfully, but these errors were encountered: