Auto-fill field immediately after making dropdown selection

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;

Not sure what you mean by the Event Wizard

Are you doing this in classic or Kinetic?

Did you do a trace (does EPicor invoke a BO when the SHip Via Code Changes)
If so, you can piggy back of that BO call

If not and its classic you can subscribe to a column changing event in the adapter and then lookup / set the appropriate value in the DataView

If its in Kinetic same rules apply, you can use a column changing trigger to do the appropriatre lookup

1 Like

Sorry for the lack of clarity.

We’re in Classic on 10.2.700. This is what I meant by the Event Wizard:

I did start by doing a trace when changing the ShipVia, but nothing at all was called.

Thank you for the suggestion about the column changing event. I will give that a whirl and report back.