When duplicating a quote (actions > quote > duplicate quote), my company uses a BPM to copy some quote line details from the original quote to the new quote. The problem is that when we upgraded our test environments to 2023.2 we discovered that the fields from QuoteDtl are not being copied correctly. For example, the order quantity on the original quote equals 6, but on the duplicate quote the quantity equals 1. Now here’s the fun part, we also copy some data from QuoteHead and that works just fine.
Our BPM resides in the Quote.DuplicateQuote BO method. I used a widget to invoke the GetByID method which populates a tableset variable of type QuoteTableset. In our custom code we query QuoteHed in this tableset and change the values of a few fields including the RowMod to “U”. Then we query QuoteDtl from that tableset as well as query the original quote details from the database. A foreach loop then looks through each line in the new quote and sets field values to the corresponding values in the old quote. This includes setting the RowMod to “U”. After the custom code widget, the Quote.Update BO method is invoked via a widget and updates the database from the tableset variable. (Screenshot of some of the custom code down below.)
When I duplicate a quote, the fields I set in Quote head copy over, but the OrderDtl values do not. I narrowed down the issue to the Quote.Update BO method by turning off all other BPM’s except the one I’m working on. I also confirmed that the fields I’m changing are changed in the tableset before I use it to update the database. I’ve spent quite a bit of time pouring though stack traces looking for any other methods and/or BPM’s being triggered that could change the data after the update I invoked, but I’ve found nothing. This is starting to smell like a bug. Why would I be able to update header details, but not line details?