How can we copy the OwnerID field from rhw sales order when creating a shipment in 2025 R2?
In prior versions we were overriding the method SetShipmentFieldsFromOrder in SOShipmentEntry. In 2025 R2 there is a new CreateShipmentExtension and it looks like the override may need to be moved to the method SetShipmentFieldsFromOrigDocument(SOShipment shipment, CreateShipmentArgs args, bool newlyCreated)?
Below is our existing code. It does not compile on 2025 R2 because the SetShipmentFieldsfromOrder method has been removed.
public class SOShipmentEntry2_Extension : PXGraphExtension<PX.Objects.SO.SOShipmentEntry>
{
[PXOverride]
public virtual bool SetShipmentFieldsFromOrder(
SOOrder order,
SOShipment shipment,
int? siteID,
DateTime? shipDate,
string operation,
SOOrderTypeOperation orderOperation,
bool newlyCreated,
Func<SOOrder, SOShipment, int?, DateTime?, string, SOOrderTypeOperation, bool, bool> baseMethod)
{
var contact = (Contact)SelectFrom<Contact>
.Where<Contact.contactID.IsEqual<@P.AsInt>>
.View.Select(Base, order.OwnerID);
shipment.OwnerID = contact?.ContactID;
return baseMethod(order, shipment, siteID, shipDate, operation, orderOperation, newlyCreated);
}
}
}Thanks in advance for the help!
Laura