Skip to main content

Is it possible to automate the update In action along with the Confirm shipment action? I am able to see there are few topics related to this. But don't have luck to complete to full process.

Please let me know if there is any chance.

Hi @ranjithduraisamy72 ,

There is no default workflow for updating and confirming a shipment in a single action. However, we can customize the process to perform both actions together, as shown below

 

public class SOShipmentEntryExtn : PXGraphExtension<SOShipmentEntry>
{
    public PXAction<SOShipment> customUpdateAndConfirm;
    
    PXButton]
    bPXUIField(DisplayName = "Update and Confirm", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
    protected virtual IEnumerable CustomUpdateAndConfirm(PXAdapter adapter)
    {
        // Call the Update action
        Base.Update.Press();  
        
        // Call the Confirm Shipment action
        Base.confirmShipment.Press();

        return adapter.Get();
    }
}
 


 

However, we can customize the process to perform both actions together, as shown below

public class SOShipmentEntryExtn : PXGraphExtension<SOShipmentEntry>
{
    public PXAction<SOShipment> customUpdateAndConfirm;
    
    >PXButton]
    PXUIField(DisplayName = "Update and Confirm", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
    protected virtual IEnumerable CustomUpdateAndConfirm(PXAdapter adapter)
    {
        // Call the Update action
        Base.Update.Press();  
        
        // Call the Confirm Shipment action
        Base.confirmShipment.Press();

        return adapter.Get();
    }
}

Because Base.UpdateIN.Press() will start a PXLongOperation, it is very likely that you will receive an error that another process has updated the record if you call Base.confirmShipment.Press() immediately after.


Reply