I’m trying to automatically fill the Tracking Number field in Customer Shipment Entry immediately following a selection in the Ship Via list.
Currently, I have an in-transaction Data Directive doing this, but the Tracking Number field does not immediately populate upon making the selection; the user has to Save first, then the Tracking Number field populates appropriately.
The value that should populate the Tracking Number field is stored in a UD field of the ShipVia table.
For context, several of our shipment methods do not have associated tracking information available (such as Will Call, Our Truck, etc.) but we still want a message to display on the automatic shipment notification email that is sent. These custom messages are things like, “Your order is ready for pickup.”
I feel like the answer is through customizing the Cust. Shipment Entry form with some kind of event, but the Event Wizard doesn’t allow me to access native fields.
How can I have the custom ShipVia message auto-populate the Tracking Number field as soon as the ShipVia selection is made?
Here is my current setup:
Here is my code:
var shipHead = ttShipHead.FirstOrDefault();
var shipVia = shipHead.ShipViaCode;
string trackingMsg = Db.ShipVia.Where(t => t.Company == Session.CompanyID && t.ShipViaCode == shipVia).FirstOrDefault().TrackingMsg_c;
var trackingNum = "";
if (!string.IsNullOrEmpty(shipVia))
{
switch (shipVia)
{
case "BG":
trackingNum = trackingMsg;
break;
case "CONT":
trackingNum = trackingMsg;
break;
case "INTE":
trackingNum = trackingMsg;
break;
case "NA":
trackingNum = trackingMsg;
break;
case "L&J":
trackingNum = trackingMsg;
break;
case "PULV":
trackingNum = trackingMsg;
break;
case "ST":
trackingNum = trackingMsg;
break;
case "VEND":
trackingNum = trackingMsg;
break;
case "WILL":
trackingNum = trackingMsg;
break;
default:
trackingNum = string.Empty;
break;
}
}
// To use in Test Messages
callContextBpmData.Character01 = shipVia;
callContextBpmData.Character02 = trackingNum;
callContextBpmData.Character03 = trackingMsg;
shipHead.TrackingNumber = trackingMsg;

