Setting the price list in Quote Line

There is a request from our business to have some logic set a specific Price List on a line. I am having some issues finding the right combination of calls to get the price list to set, and to have the price pull in.
Current flow in a Function (eventually moving to a BPM, but using function just to validate calls)

  • populate UpdExtQuoteTableset QuoteDtl and QuoteHed.
  • Update QuoteDtl OverridePriceList = true, BreakListCode and PriceListCode to the new Pricelist code, and rowmod = “U”
  • Call Quote.UpdateExt
  • At this point the price list is changed in the Quote, but the prices and break qty have not been updated.
  • Quote.GetByID into a QuoteTableset
  • call Quote.QuoteDtlRefreshPriceListAndQuantities((refreshQty)true, (GetDiscountPriceListInfo)false, (ClearQuoteQty)true, ref quoteTS)
  • **correct price is pulled into the QuoteTableset
  • call Quote.Update
  • **This is where it just resets back to default the PriceList.

This flow is based on the stack trace I pulled from Kinetic when manually changing the Price List, but something more seems to be needed.

After the line is already added to the quote? Why not before? What is triggering the change?

it would be after the line is added. The goal is to allow the user to choose a price list that would update all eligible lines on the quote with the new price list based on different pricing structures and contracts that our sales team uses.

Did you try with update instead of updateext?

Yeah, but it doesn’t commit. no errors, just doesnt update in the database. The only way I was able to get it to stick was UpdateExt.
When I ran the stack trace it only shows the Price List Codes being changed.

It doesn’t sound like your code is following the trace, might need the before image.

image
This is the stack trace of methods called. I went through the Events in App studio and confirmed what was being called.
PreRefreshQty just controls what message is displayed to refresh the QuoteQty. I default to true.
QuoteDtlRefreshPriceListAndQuantities pulls in all the information for the new PriceList values into the tableset.
Update is called to commit the data.

I recreated this in code in a function for better tracking of changes.

I can see the values being updated to what they should be in the tableset.
Datacheck before change: Override PL: False PL Code: OWAJAN25 rowmod: BL Code: OWAJAN25 UnitPrice: 1357.00000 refreshQTy: False
Datacheck before update: Override PL: True PL Code: OMNIAJan25 rowmod: U BL Code: OMNIAJan25 UnitPrice: 1205.00000 refreshQTy: True
Datacheck after update: Override PL: False PL Code: OWAJAN25 rowmod: BL Code: OWAJAN25 UnitPrice: 1357.00000 refreshQTy: False

You’ll have to look at the datasets to figure out what is different between what you are sending in your function and what is sent in the ui. Might need to create the before image in the ds.

I was about to say what Alisa mentioned, it might be a buffer copy?