C# Issue with lines requesition

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.

How would I go about calling that same method, I only have the method name? @Banderson

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.

Unfortuanly I can’t use those tools here. Hopefully you could show me how to do one then I could finish the others i’m sure

> <tracePacket>
>   <businessObject>Erp.Proxy.BO.ReqImpl</businessObject>
>   <methodName>ChangeUnitPriceConfirmOverride</methodName>
>   <appServerUri><test></appServerUri>
>   <returnType>System.Void</returnType>
>   <localTime>4/29/2019 08:48:06:1915253 AM</localTime>
>   <threadID>1</threadID>
>   <executionTime total="13" roundTrip="8" channel="0" bpm="0" other="5" />
>   <retries>0</retries>
>   <parameters>
>     <parameter name="ds" type="Erp.BO.ReqDataSet">
>       <ReqDataSet xmlns="http://www.epicor.com/Ice/300/BO/Req/Req" />
>     </parameter>
>     <parameter name="sConfirmMsg" type="System.String"><![CDATA[]]></parameter>
>   </parameters>
> </tracePacket>

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.

Why can’t you use those tools?

any help would be appreciated.

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.

1 Like

Blake,
this is Lorenzo,

use the update medhot in your for loop,
that should save the data,

i hope,

Hello Lorenzo

I think I need to understand how Epicor uses the methods and where to get the parameter values. Could you email me what you are suggesting please?

unfortunately on the after field change method when I refresh it just gets rid of the line entirely.