So looks like seemingly easy things in Acumatica are terribly complicated to implement. All I wanna do is to copy last row of my grid as a new one. I would like the user to pers
The code should be like this:
public PXAction copyLastRow;
[PXUIField(DisplayName = "Copy Last Row", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXProcessButton]
public virtual IEnumerable CopyLastRow(PXAdapter adapter)
{
SOLine line = Base.Transactions.Select().LastOrDefault();
SOLine newLine = new SOLine();
... (copy all you need from line to newLine)
Base.Transactions.Cache.Insert(newLine);
Base.Actions.PressSave();
return adapter.Get();
}