Set Field With Button for autoprint

This seems easy enough and I have seen a few mentions on here about doing it but have little to no c# experience so am struggling. I want to set a ud Boolean field on the rcvhead table to true with the click of a custom button on receipt entry screen. I will use this for my condition to autoprint a BAQ report that needs pack slip as a parameter. I know how to add the button click event code and am familiar with autoprint functionality but not the code to set the field to true that I will put in my button click event. Any guidance is greatly appreciated, Hope everyone has a fantastic Insights, sadly not making it this year.

Thank in advance
Andrew Crank
Business Systems Analyst
Butternut Mountain Farm

Assuming the UD field is part of the table already, it should show up in the EpiDataView (what your controls are bound to).

On the desired form, find the appropriate edv name - you can do this by using field help, or the Object Explorer in data tools.

From there you just reference it:
var MyDv = oTrans.Factory(“Name of the edv”);
MyDv.dataView[MyDv.Row][“MyFieldName_c”] = true;

Thanks Chris, had to do some minor tweaking due to it being a custom form/dataview originally but your snipet lead me to the solution.

Thanks,
Andrew

1 Like