Skip to main content
Solved

I set value to custom field but it's not save until I change ui and save

  • 11 June 2024
  • 6 replies
  • 91 views

this is my code in open opportunity screen. I can get on screen but it doesn’t save until change value in ui. if I don’t change any value on screen and leave the screen, the data is gone

 

6 replies

Userlevel 2
Badge

Have you tried setting the value like this?
Base.Opportunity.SetValueExt<CROpportunityExt.usrExtArea>(row, contactExt.UsrExtArea);

Userlevel 2
Badge

Have you tried using the following code?

Base.Actions.PressSave(); instead of Base.Save.Press();

Badge +12

I don’t see any issues with your code. There are multiple ways you could be doing it, but it looks fine to me. I wonder if you’re not fighting the workflow engine, since the Open action is a workflow action. Have you tried executing the baseMethod before your code?

public IEnumerable open(PXAdapter adapter, openDelegate baseMethod)
{
var row = Base.Opportunity.Current;

var result = baseMethod(adapter);

// Your code

return result;
}

 

Userlevel 3
Badge

thank you all I solve it. 

Userlevel 7
Badge

Hi @vannakheng66 , Can you share how you solved it? Thank you!

Userlevel 3
Badge

Hi @vannakheng66 , Can you share how you solved it? Thank you!

In Opportunity we have projection so we need to extend that project class more.

Reply