Quote pricing drops if ship to changed (only if part not in system)

When we create quotes, sometimes they have an existing part, resale part, or custom part. If existing or resale, the pricing is part of the customer’s price list and when ship to changes, it re-grabs the price. HOWEVER, if a custom part (one that isn’t on any price list), the current pricing goes to zero and needs to be all re-entered.

Any suggestions how to maintain the pricing for lines that are custom parts?

On preprocessing of the method or update put the price into a Numberxx field, then on post processing reassign the Numberxx back to the price.

Do you know which action I use to put the price (DocUnitPrice) into a numberxx field? Is it "set the specified field of the changed row to the specific expression’?

That will work.

Hmm… still not sure how to store the value using the “specific expression” area.

If I’m on the right track, I think I need to do the following, but don’t know the details:

  1. If quote line is a custom part (not sure how to check), then store the UnitPrice in preprocesing of Quote.RecalcWorksheet
  2. Let recalc run
  3. Somehow run a post processing to reset the UnitPrice back to what it was (instead of zero)

I’m lost on how to pull these pieces together. Any further help appreciated.

(is what I’m trying to do even possible?)

let’s just use abl. it is pretty simple. on Quote.update or recalc use the pre processing below to save the price. to make sure that method is getting called stick a simple informational message on the pre processing.
The post processing will go likely on the same method.

i copy pasted these from mine that I use for POs and they compile, but I have not run them. I used OrdBasedprice, but that may not be right.

This is the pre processing
/* Save price in Number01 */

for each ttQuotedtl.

Assign ttQuoteDtl.number01 = ttQuoteDtl.OrdBasedPrice.

Assign ttQuoteDtl.LockPrice = true. /* this might do it */

End.

This is the post processing
/* reset price from Number01 */

def var partFound as logical init false.

for each ttQuotedtl.

	For first Part where Part.company = cur-comp and Part.PartNum = ttQuoteDtl.PartNum.

			partFound = true.
		
	End.

	If partFound = false Then 
			Assign  ttQuoteDtl.OrdBasedPrice = ttQuoteDtl.number01.

End.

Greg,

Thank you for some direction, but I’m in need of a bit more. I found out that Quote.update seems to be the right method (no info message popped up on Quote.recalc when changing shipping).

I copied your code, but the price still goes to zero after changing shipping. Also, while ttQuoteDtl.OrdBasedPrice could be the right column I see the following in the QuoteDtl table that store the price:

ListPrice
DocListPrice
OrdBasedPrice
DocOrdBasedPrice
ExpUnitPrice
DocExpUnitPrice

(all 6 of these columns store the price, then they go to zero when shipping is changed).

1st. Does Number01 get the price on preprocessing? If not then we need to find the proper variable.

2nd Turn on tracing and check track changes only, then change the price in the quote to see which one(s) get updated when you manually enter the price. We will update all of them with the saved price.

Greg,

Thank you for some direction.

1 - No, it doesn’t appear that Number01 is getting the data. When I just have pre-processing running, update the quote, then check in the DB, Number01 fields are all zero. Is this right way to validate that the field is getting the data?

2 - With tracking on, Quote.Update sets these fields with the value that I set: UnitPrice, DocUnitPrice, TotalQuotedPrice, WQUnitPrice

Yes, you should see number01 with data.

Change the number01 assignment to use one of the fields from your trace ( probably Unitprice or DocUnitPrice will work) and verify the data is in the db.
Once it is in the db, then use the same field on the reassignment.

Tried that, but I get an “unknown field or variable name” error when I validate the ABL.

Also, if I were to get the value into one of those fields during the preprocessing then it wouldn’t it just be reset to zero during base processing, leaving me with lost pricing again?

Thanks.

make an informational message and look for the unitprice fields in there. You need to find where the value is. Add the possible ones to the message so you can find which ones are holding the data.

the value will be in number01 during base processing, so it can be retrieved in post processing.

Okay, it seems like I was looking in the wrong tt table. I found the value in ttQuoteQty.UnitPrice (not ttQuoteDtl).

How should my ABL then change? I’m not getting any value being saved to Number01.

for each ttQuotedtl.
Assign ttQuoteDtl.Number01 = ttQuoteQty.UnitPrice.
Assign ttQuoteDtl.LockPrice = true.
End.

Change the for each to ttQuoteQty and use ttQuoteQty.Number01 to hold the Uniprice for each Qty.
Remove or comment out the lockprice for now.

Okay. Now, when I change the DocUnitPrice price at the line level it saves that price in ttQuoteQty.Number01.

However, when I change the shipping address, the ttQuoteQty.Number01 value goes back to zero… Here is my pre-processing code:

for each ttQuoteQty.
Assign ttQuoteQty.Number01 = ttQuoteQty.UnitPrice.
End.

it could be a simple as if ttQuoteQty.Unitprice <> 0 Then
Assign ttQuoteQty.Number01 = ttQuoteQty.UnitPrice.

and

if ttQuoteQty.Unitprice = 0 and ttQuoteQty.Number01 <> 0 Then
Assign ttQuoteQty.UnitPrice = ttQuoteQty.Number01.

Nope, nothing. Tried both and stuck.

Thanks for all your help. I learned a bunch on this post, but no idea where to take this.

let’s just look at not clearing the number01. Did the if condition not clear it. You may also have to check for 0.0 instead of 0 or > rather than <>

I have the following pre-processing on Quote.Update:

for each ttQuoteQty.
if ttQuoteQty.Unitprice > 0 Then
Assign ttQuoteQty.Number01 = ttQuoteQty.UnitPrice.
End.

When I add a price to the part not in system (in the quantities box under Line > Detail), the price saves in QuoteQty.Number01. Then, when I go to the Summary Tab and change the ship to, save, the price in Number01 goes to zero.

(I don’t have any post-processing enabled).

This one is odd. I was looking at my server log and noticed in another one of my quote bpms the rowmod was D as in deleted. I then looked at the sysRowID of QuoteQty and it was different. There is nothing to retrieve because the row is gone. Apparently of the QuoteQty rows are remade on a shipto number change.

The price will have to be stored elsewhere. Do you have the Quote.GetShipToInfo method?