So I have added 2 boxes into the lines, one is budget # and the other is the chart. It pulls that data from the header.
private static void SetReqDetailInfo()
{
DataRowView rhView = (oTrans.EpiDataViews["ReqHead"] as EpiDataView).dataView[0];
string budgetNo = rhView["budget"].ToString();
string chart = (rhView["division"].ToString()) + "-" + (rhView["Dept"].ToString()) + "-" + (rhView["Chart"].ToString());
EpiDataView rdView = (oTrans.EpiDataViews["ReqDetail"] as EpiDataView);
int lineCount = rdView.dataView.Count;
for (int i = 0; i < lineCount; i++)
{
rdView.dataView[i]["Budget"] = budgetNo.ToString();
rdView.dataView[i]["GLAccount"] = chart.ToString();
}
}
When I do it this way it sets the box text correctly for all the lines BUT when I enter in “our quanity” it no longer autofills the supplier quanity and doesnt update the EXT cost either.
The autofill is going to probably be one of those “changeon…” methods. Do a trace while changing them and you will see it. You will need to call that same method to get that to change like the stock one does.
The trace will have the parameters that you need to call the method. The BL tester can be helpful when you are trying to understand the call, or use Jose’s Visual studio extension to help you. It will help describe the parameters as well.
I’m not a super coder (just a beginning one), so I would have to get all of it set up to be able to make sure it works before I post any kind of code, and I just don’t have time this week.
Another thing to try is a notify. Search the forum for oTrans.notify or oTrans.notifyall and there should be some examples. If you change something in a view you have to tell Epicor you changed it. (I forgot about that) that notification might call the onchange method on its own.