Update a field in Order Header with data from CustMFBill table

,

When we enter a new order, I would like the OrderHed.PayFlag combo box to default to the value in CustMFBill.PayFlag table for customer. I have been unsuccessful following posts here for both a BPM using custom code, and for trying to call BO/methods without code. Any suggestions would be appreciated!

In Customization for Order Entry:

  1. Add new Foreign Key View (Customer) under OrderHed for CustNum

  2. Add new Sub Table View (CustMFBill) under (Customer) FKV linking Company and CustNum

  3. Use wizard for OrderHed.AfterFieldChange CustNum to change OrderHed.PayFlag = CustMFBill.PayFlag

     private void OrderHed_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
     {
     	// ** Argument Properties and Uses **
     	// args.Row["FieldName"]
     	// args.Column, args.ProposedValue, args.Row
     	// Add Event Handler Code
    
     	switch (args.Column.ColumnName)
     	{
     		case "CustomerCustID":
     			EpiDataView edvOrderHed = (EpiDataView)oTrans.EpiDataViews["OrderHed"];
     			EpiDataView edvCustMFBill = (EpiDataView)oTrans.EpiDataViews["CustMFBill"];
     			edvOrderHed.dataView[edvOrderHed.Row]["PayFlag"] = edvCustMFBill.dataView[edvCustMFBill.Row]["PayBTFlag"];
     			oTrans.NotifyAll();
     			break;
     	}
     }

Yes it worked, thank you very much! Mike

edit