Hello,
I have an action that I would like to run as a process on a sales order. It’s really an ‘initialize’ action where I can do some validation while I save it. I have simplified the code to the base where I’m still getting the same behavior. Ultimately, I want to persist the record before I do any processing due to the way the system caches data on the tables/items I’m running calcs on. Can anyone tell me why when I execute this action (before initially saving) the system redirects me to a blank sales order? In order to find it again, I have to press the “Last” button to get back into it.
public PXAction<SOOrder> Test;
[PXProcessButton(CommitChanges = true, Category = "Processing", Connotation = PX.Data.WorkflowAPI.ActionConnotation.Success)]
[PXUIField(DisplayName = "Test")]
protected IEnumerable test(PXAdapter adapter)
{
Base.Save.Press();
return adapter.Get();
}
Alternatively, if I save manually before pressing the button, I have no issues and it keeps me on the same order.
I really just want to know if there is something I’m missing on the setup and if not, what people do to ‘hide’ these types of buttons to force someone to save it before the system will let them execute. I’m even willing to consider a row selected event handler to hide the action until some field has been initialized.. but I’m not sure which field that would be.
Thanks in advance!
Best answer by Dmitrii Naumov
View original