Skip to main content

Hello 

I am Currently Customizing the Process Shipment screen and I want to add new value Print packing Slip to the existing, process shipment screen. 


I was able to add the new value via, the customization package.


However, when I run my code, via extending the process shipment graph, I do not see the selected value.


 The goal I am trying to achieve , here is I want to run a report ( Shipment packing slip) via the process shipment screen. I have the report code working. All I want to do is , call this report via dropdown on the process shipment Action filter. 


public PXAction<SOShipment> printPackingSlip;
PXButton(CommitChanges = true)]
PXUIField(DisplayName = "Print Packing Slip", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
public virtual IEnumerable PrintPackingSlip(PXAdapter adapter)
{
return Base.Report(adapter.Apply(delegate (PXAdapter it)
{
it.Menu = "Print Packing Slip";
}), "SO6420PS");
}

Could anyone please suggest, the correct approach to add new value and append it to the existing drop-down on process shipment.





 
 

You need to extend the workflow definition for that screen to include your new action.

 

Here is sample code that I used in a similar situation:

using System;
using PX.Data;
using PX.Data.WorkflowAPI;
using PX.Objects.IN;
using PX.Objects.SO;

namespace PrintInventoryLabels
{
using static PX.Data.WorkflowAPI.BoundedTo<SOShipmentEntry, SOShipment>;

public class PrintInventoryLabels_SOShipmentEntry_WorkflowExt : PXGraphExtension<PX.Objects.SO.SOShipmentEntry_Workflow, SOShipmentEntry>
{
public override void Configure(PXScreenConfiguration config) =>
Configure(config.GetScreenConfigurationContext<SOShipmentEntry, SOShipment>());

protected virtual void Configure(WorkflowContext<SOShipmentEntry, SOShipment> context)
{
#region Custom Actions

var actionPrintInventoryLabels = context.ActionDefinitions.CreateExisting<PrintInventoryLabels_SOShipmentEntry_Extension>(g => g.PrintInventoryLabels, a => a
.DisplayName("Print Inventory Labels")
.WithCategory(printingAndEmailingCategory)
.WithPersistOptions(ActionPersistOptions.PersistBeforeAction)
.MassProcessingScreen<SOInvoiceShipment>()
.MapEnableToUpdate()
);

#endregion

context.UpdateScreenConfigurationFor(screen =>
{
return screen
.WithActions(actions =>
{
actions.Add(actionPrintInventoryLabels);
});
});
}
}
}

 


Hi @darylbowman I am not able to extend the work flow definition for that screen.

 



 

    public class SOInvoiceShipment_Workflow_Extension : PXGraph<SOInvoiceShipment>
    {
        public static bool IsActive() => true;
        public override void Configure(PXScreenConfiguration config) => 
            Configure(config.GetScreenConfigurationContext<SOInvoiceShipment, SOInvoiceShipment>());
        

        protected virtual void Configure(WorkflowContext<SOInvoiceShipment, SOInvoiceShipment> context)
        {

        }
    }

 


Do I need to extend the SOshipmentEntry Instead?
Could you please elaborate on how were you able to extend the work flow definition for the process shipment screen? 

Thank you


Yes, you should be extending SOShipmentEntry. This basically maps an action to a processing screen, which makes it available to mass process on that screen. This can also be done through the visual workflow, but I prefer code.


Reply