Solved

Sales Quotes Unit Price gets nulled after populating Customer field on the header

  • 10 April 2024
  • 7 replies
  • 76 views

Userlevel 1

Hi everyone,

i’m facing a problem when i populate the Sales quotes lines from an imported file, everything is working fine when the lines were populated, but when i choose a customer from the header field, the fields returns zero for all the rows : 

Unit Price with the values

and after choosing a customer:

 

field returns 0

i tried to use RowUpdated to get the old values back if the new value is 0 : 
 

public static bool IsActive() => true;
protected virtual void _(Events.RowUpdated<CROpportunityProducts> e)
{
var nR = e.Row;
var oR = e.OldRow;

var nUnitPrice = nR.CuryUnitPrice;
var oUnitPrice = oR.CuryUnitPrice;


if (nUnitPrice == 0)
{
nR.CuryUnitPrice = oUnitPrice;
}
}

the code works fine, but the Ext Price is still showing 0, and automatically the Amount field also:
 


Any thoughts?

icon

Best answer by aiwan 4 June 2024, 15:24

View original

7 replies

Userlevel 7
Badge +10

Is there a reason that you aren’t populating the Customer/Business Account first?  The system wants to recalculate prices when the customer changes

Userlevel 4
Badge +1

Hi @hmzamr,

How do you do your pricing?

 

Is the Test account allocated a price band if you use price banding?

 

As a workaround, could you upload the file again after changing the customer?

 

If you use the ‘Update All Existing’ when importing the file, this will leave all that is the same and change all different values.

Userlevel 4
Badge +1

but if all that fails,

 

protected virtual void _(Events.FieldUpdated<CROpportunityProducts, CROpportunityProducts.inventoryID> e)
{
CROpportunityProducts row = e.Row;

if(row.InventoryID == null) return;

if(row.InventoryID != null)
{
e.ReturnValue = row.CuryUnitPrice * row.Quantity;
}
}

Let me know if this works, however I think it would be best to not modify this with more logic, but rather get down to the core issue.

 

We use price banding and if a customer has no price band allocated, we also see this effect.

 

After allocation, the prices should change by customer if the price band is different.

 

I think the reason your RowUpdated Handler also doesnt trigger  is because you dont use the SetValueExt method which won’t call the FieldUpdated event handler to cause the PXFormula within CuryExtPrice to trigger.

Userlevel 1

Any one can help here?

Userlevel 1

@meganfriesen37 yes, i know that it’s a recalculation issue, but for example if i populate it with the wrong customer then i correct it, it will be nulled, i wanted to know if i can fix this behaviour

 

Userlevel 7
Badge

Hi @hmzamr were you able to find a solution? Thank you!

Userlevel 4
Badge +1

I’m also pretty sure there should be a recalculate prices button within Sales Quotes, that might be worth checking out.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved