Hello Everyone,
I have one scenario where I want to put Sales Order on Hold at the time of order import from BigCommerce to Acumatica based on some conditions.
I have implemented some logic in 19R2 build and that is working as expected there, as after checking required conditions, I used to set impl.Hold = true.ValueField(); please find below code sample for reference.
public delegate void MapBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing);
PXOverride]
public void MapBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, MapBucketImportDelegate baseMethod)
{
baseMethod(bucket, existing);
MappedOrder obj = bucket.Order;
OrderData data = obj.Extern;
SalesOrder impl = obj.Local;
impl.Hold = true.ValueField(); // This implementation working fine in 19R2
}
Now, coming to 21R1 we do not have Hold checkbox on Sales Order screen and instead we have Hold button to put the document on hold. So, the 19R2 implementation is not working here.
I tried below ways to achieve that but that did not helped. Please find below samples for reference:
- Keeping the 19R2 implementation as it is, to set impl.Hold = true.ValueField();
- Overridden Persist method on Sales Order Entry graph.
- Calling Base.putOnHold.Press(); before base save.
public delegate void PersistDelegate();
{
if (Base.Document.Current != null && Base.IsImport == true)
{
Base.putOnHold.Press();
}
del();
}
- Calling Base.putOnHold.Press(); after base save.
public delegate void PersistDelegate();
PXOverride]
public void Persist(PersistDelegate del)
{
del();
if (Base.Document.Current != null && Base.IsImport == true)
{
Base.putOnHold.Press();
}
}
- The other way I thought to set Sales Order Status to Hold, but that not seems to be proper way to put document on Hold.
Can someone suggest the best possibility way to achieve this please.
Thank you in advance !