Skip to main content
Solved

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


Forum|alt.badge.img

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?

Best answer by aiwan

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.

View original
Did this topic help you find an answer to your question?

7 replies

Forum|alt.badge.img
  • Author
  • Freshman I
  • 11 replies
  • April 12, 2024

Any one can help here?


meganfriesen37
Captain II
Forum|alt.badge.img+11

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • 11 replies
  • April 13, 2024

@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

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2749 replies
  • June 3, 2024

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


Forum|alt.badge.img+8
  • Captain II
  • 362 replies
  • Answer
  • June 4, 2024

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.


Forum|alt.badge.img+8
  • Captain II
  • 362 replies
  • June 4, 2024

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


Forum|alt.badge.img+8
  • Captain II
  • 362 replies
  • June 4, 2024

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings