I am modifying Epicors RMA Process Form. I want to use the functionality they already have built in which in on a field leave it will get the new customer. I have the code to populate the boxes and all of that but I have to use separate buttons to keep the process flowing. I have to manually tab out of the box and then click another button to restart the process. Is there a way to send a tab key button press so the cursor leaves the field and performs the built in functions on a field leave?
private static void epiButtonC2_Click(object sender, System.EventArgs args)
txtCustomerCustID.EpiBinding = "";
epiButtonC2.Visible = false;
btnContinueNonCon.Visible = true;
txtCustomerCustID.Visible = true;
txtCustomerName.Visible = true;
txtCustomerCustID.Text = tbCustIDRef.Text;
txtCustomerCustID.EpiBinding = "RMAHead.CustomerCustID";
//Would like a tab here and then I could go right into the next.
//txtOrderNum.EpiBinding = "";
So the only reason I was messing with the control was because when I launch the form the field attached to the Data View won’t accept a parameter I pass. I can pass it into a text box that isn’t bound. Is there a way I can just have that field accept a parameter passed in on load?
Customized the Part Maint form to set the Alt PartNum upon clicking a button. The button click set the alt partnum field, and would give it focus, then take take away focus, and the Alt Part Desc would update as if I had tabbed out of the Alt PartNum field:
Did you run a trace? There are some methods that are called when a field changes (for example in the transfer inventory screen when changing bin locations, there is a server method that looks up the qty on hand). So something when leaving fields, there is some interaction with the server. I would bet that on that field, it’s something similar. It should show up in a trace.
What do you mean launch the form? Can you give us some insights as to the end goal? It appears form the code you shared you are just filling out a textbox from another textbox. What do you mean by Launch the form @skearney
So when you are changing the control, the control is changing the data view, it is triggered when you leave the field. So if you skip the field and go right to the dataview, you should be able to change the dataview directly, then run a notify to notify that it changed. Basically changing the focus is like turning your car right to turn the turn signal off, going to the dataview is like just turning off the turn signal.
something like this (warning, untested code to follow)
EpiDataView testView = (EpiDataView)(oTrans.EpiDataViews["RMAHead"]);//gets your data view
String testCustID = (string)testView.dataView[testView.Row]["CustomerCustID"];//get's the current custID, can skip really
testView.dataView[testView.Row]["CustomerCustID"] = "your value here";//sets the value new value of the customer ID
testView.dataView[testView.Row]["RowMod"]="U"; // sets the row mod so that it knows it's upated
testView.Notify(new EpiNotifyArgs(oTrans, testView.Row , testView.Column)); //triggers the change so it goes to the server to do the work.
So if you can do that instead of the focus changing thing.
(and credit goes to @josecgomez for the notify on the last line. I was going to use notify all and he pointed out that was overkill)