I’m puzzled over this - hopefully it’s something silly that I’m missing.
I have an Action button on SOOrderEntry. The goal is to look through the detail lines on the order, create a record in another graph, update some fields on SOLine and save the order.
Each time I call Actions.PressSave from within the CreateJobs method I get the error “The record cannot be saved.” I thought I was doing something wrong so I stripped out all of the code. I’ve tried it on two different Acumatica installations.
public static bool IsActive()
{
return true;
}
public PXAction<SOOrder> TestAction;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Create Test", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true)]
protected virtual IEnumerable testAction(PXAdapter adapter)
{
Base.Actions.PressSave();
var graphCopy = Base;
PXLongOperation.StartOperation(graphCopy, delegate () { CreateJobs(graphCopy); });
return adapter.Get();
}
private static void CreateJobs(SOOrderEntry soOrderEntry)
{
soOrderEntry.Actions.PressSave();
return;
}
As you can see - I’ve stripped down the code to doing nothing at all.
So there must be something that I’m not understanding or missing. I feel like this is right out of T230 - what am I missing?
Best answer by Django
View original