Delivery Lock During Editing from Plugin
Tags:
v9
The ability to lock delivery during editing from the plugin has been added to prevent conflicts when editing simultaneously through Front and the web Call Center.
Features
- Locking via
TryStartDeliveryEdititng - The lock applies to all terminals in the group
- Indication in the Front UI about the lock by the plugin
- Automatic release when exiting
ExecuteContinuousOperation
Usage
The TryStartDeliveryEdititng method can only be used within ExecuteContinuousOperation. The lock is automatically released upon exiting ExecuteContinuousOperation.
PluginContext.Operations.ExecuteContinuousOperation(os =>
{
var delivery = os.GetDeliveryOrders().Last();
if (os.TryStartDeliveryEdititng(delivery.Id))
{
// Delivery is locked, editing can proceed
var editSession = os.CreateEditSession();
// Make changes
os.SubmitChanges(editSession);
}
else
{
// Handle the situation when the delivery is already locked
}
});