Hello Everyone,
In the persist delegate, I would like the custom field inside the PXLong Run operation but value is not updating. Can anyone help me on this?
If try to save again, it is re-calling the Persist method and going to the infinite loop.
Here is the sample code for your reference.
public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate baseMethod)
{
baseMethod();
if (Base.Document.Current != null)
{
PXLongOperation.StartOperation(Base, delegate ()
{
try
{
//my custom logic is here
//Updating the custom field value below, value is holding in the caches but updating
Base.Document.Cache.SetValue<SOOrderExt.usrCustomField>(Base.Document.Current, true);
Base.Document.Cache.Update(Base.Document.Current);
}
catch (Exception ex)
{
throw ex;
}
}
}
}
Best answer by Naveen Boga
View original