Skip to main content
Solved

An error while processing the field: confirmShipmentAction from PX.Objects.SO.SOShipmentEntry

  • June 16, 2026
  • 1 reply
  • 13 views

Jhon Reeve Penuela
Jr Varsity III
Forum|alt.badge.img

Hi Everyone.

I Developing webhook but while publishing i encounter error 

An error while processing the field: confirmShipmentAction from PX.Objects.SO.SOShipmentEntry

and this my current setup.

  public async Task HandleAsync(WebhookContext context, CancellationToken cancellation)
{

#region Connection Setup
PXDataRecord? record = PXDatabase.SelectSingle<AISCubiicConnectionSetup>(
new PXDataField<AISCubiicConnectionSetup.userName>(),
new PXDataField<AISCubiicConnectionSetup.tenantName>()
);

string? userName = record.GetString(0);
string? tenantName = record.GetString(1);

string fullUsername = string.IsNullOrWhiteSpace(tenantName)
? userName
: $"{userName}@{tenantName}";
#endregion

using (new PXLoginScope(fullUsername))
{
using (var jr = new JsonTextReader(context.Request.CreateTextReader()))
{
var payload = Serializer.Deserialize<ConsignmentsResponse>(jr);

if (payload == null)
{
context.Response.StatusCode = 400;
return;
}

SOShipmentEntry shipmentGraph = PXGraph.CreateInstance<SOShipmentEntry>();
SOOrderEntry sOOrderEntry = PXGraph.CreateInstance<SOOrderEntry>();

// Load all carriers once — keyed by Description — to avoid a DB query per consignment
var carriersByDescription = SelectFrom<Carrier>.View
.Select(shipmentGraph)
.RowCast<Carrier>()
.Where(car => car.Description != null)
.ToDictionary(car => car.Description!.Trim(), car => car,
StringComparer.OrdinalIgnoreCase);

foreach (var c in payload)
{
if (string.IsNullOrWhiteSpace(c.ItemReference) ||
string.IsNullOrWhiteSpace(c.SenderReferences))
continue;

shipmentGraph.Document.Current = shipmentGraph
.Document.Search<SOShipment.shipmentNbr>(c.SenderReferences);

sOOrderEntry.Document.Current = sOOrderEntry
.Document.Search<SOOrder.orderNbr>(shipmentGraph.soorder.Current.OrderNbr);

if (shipmentGraph.Document.Current == null) continue;

shipmentGraph.Packages.Current = shipmentGraph
.Packages.Search<SOPackageDetail.shipmentNbr>(c.SenderReferences);

SOPackageDetailEx sOPackageDetail = new SOPackageDetailEx();

if (shipmentGraph.Document.Current.ShipmentNbr != null)
{
shipmentGraph.Document.Cache.
SetValueExt<SOShipmentExtension.usrAISConsignmentNbr>
(shipmentGraph.Document.Current, c.ConsignmentNo);

carriersByDescription.TryGetValue(
c.CarrierName?.Trim() ?? string.Empty, out Carrier? carrier);

if (carrier == null)
throw new PXException(
// Acuminator disable once PX1053 ConcatenationPriorLocalization [Justification]
String.Format(Message.CarrierNotFound, c.CarrierName));

shipmentGraph.Document.Cache
.SetValueExt<SOShipment.shipVia>
(shipmentGraph.Document.Current, carrier.CarrierID);

shipmentGraph.Document.Cache
.SetValueExt<SOShipmentExtension.usrAISTrackingURL>
(shipmentGraph.Document.Current, c.TrackingUrl);

shipmentGraph.Document.Cache
.SetValueExt<SOShipmentExtension.usrAISServiceName>
(shipmentGraph.Document.Current, c.ServiceName);

sOPackageDetail.Confirmed = true;

sOPackageDetail.BoxID = c.ItemUnitOfMeasureName;

sOPackageDetail.TrackNumber = c.ConsignmentNo;

sOPackageDetail.Description = c.ItemReference;

sOPackageDetail.Height = c.ItemHeight;

sOPackageDetail.Weight = c.ItemWeight;

sOPackageDetail.Width = c.ItemWidth;

sOPackageDetail.Length = c.ItemLength;

shipmentGraph.Document.Cache.Update(shipmentGraph.Document.Current);
shipmentGraph.Packages.Cache.Update(sOPackageDetail);

}
}

shipmentGraph.Actions.PressSave();

shipmentGraph.confirmShipmentAction.Press();

}
}
}

Thanks.

Best answer by Jhon Reeve Penuela

I figure out. i need to update my instance to make display the new dll’s update

1 reply

Jhon Reeve Penuela
Jr Varsity III
Forum|alt.badge.img

I figure out. i need to update my instance to make display the new dll’s update