clmates
Reputable Poster
Hi to all.
We have made a customization to R42565 that changes the payment terms based on total invoice amount.
We used a custom table to store the customer AN8, the amount lower limit and the new payment terms to apply.
In order to change this at invoice runtime, we created a business function in NER that we call in the Phase 1 Build File End Section, Just at the begin of the section (before the Detail Line 1 Section is Called)
The business function loops on F42565 (using handles), and calculates the invoice total amount, then on invoice change, checks the customer for payment term rules (on the custom table), and updates the F42565 PTC and F4211 PTC accordingly.
the problem we had notice is that sometimes the Detail Line 1 Section is running before the F42565 table is totally updated, we also run the update using a handle.
here are the questions:
1. This could be solved using a transaction?
2. Could we include in the transaction only the call and updates of this NER?
3. Could this problem be related to use the flag "Check for Record Change" on the updates to F42565 and F4211, could this impact performance?
We had other similar customization for adding a line to F4211 amd F42565 for freight charges and is running fine, the only difference is that this one uses inserts and the one failing uses updates.
Many Thanks
We have made a customization to R42565 that changes the payment terms based on total invoice amount.
We used a custom table to store the customer AN8, the amount lower limit and the new payment terms to apply.
In order to change this at invoice runtime, we created a business function in NER that we call in the Phase 1 Build File End Section, Just at the begin of the section (before the Detail Line 1 Section is Called)
The business function loops on F42565 (using handles), and calculates the invoice total amount, then on invoice change, checks the customer for payment term rules (on the custom table), and updates the F42565 PTC and F4211 PTC accordingly.
the problem we had notice is that sometimes the Detail Line 1 Section is running before the F42565 table is totally updated, we also run the update using a handle.
here are the questions:
1. This could be solved using a transaction?
2. Could we include in the transaction only the call and updates of this NER?
3. Could this problem be related to use the flag "Check for Record Change" on the updates to F42565 and F4211, could this impact performance?
We had other similar customization for adding a line to F4211 amd F42565 for freight charges and is running fine, the only difference is that this one uses inserts and the one failing uses updates.
Many Thanks