# Setting default field values

**URL:** <https://www.epiusers.help/t/setting-default-field-values/61151>\
**Category:** Epicor ERP 10\
**Tags:** customization\
**Created:** [October 24, 2019, 7:24pm UTC](https://www.epiusers.help/t/setting-default-field-values/61151 "2019-10-24T19:24:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Asz0ka](https://www.epiusers.help/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Asz0ka](https://www.epiusers.help/u/Asz0ka)\
**Post date:** [October 24, 2019, 7:49pm UTC](https://www.epiusers.help/t/setting-default-field-values/61151/2 "2019-10-24T19:49:07Z")

</div>

I’ve banged my head against this before, here’s some code I found to get it to stick (this is on the Corrective Action Entry module) I used the form event wizard to get the EpiViewNotifcation event code, then added the if statement and view.dataView.edit parts:

```
private void edvDMRCorAct_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
	// **Argument Properties and Uses**
	// view.dataView[args.Row]["FieldName"]
	// args.Row, args.Column, args.Sender, args.NotifyType
	// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
	if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
	{
		if ((args.Row > -1))
		{
			if (Convert.ToInt32(nonconfTextBox.Value) == 0)
			{
				view.dataView[view.Row].BeginEdit();
				view.dataView[view.Row]["NonConfNum"]=1;
				view.dataView[view.Row].EndEdit();
			}
		}
	}
}

```

![image](https://epiusers.help/uploads/default/original/3X/4/6/46fffe3f3ad17c33e82109060030e2c1e1492724.png)

After clicking new:

![image](https://epiusers.help/uploads/default/original/3X/5/8/58509750dae9778352294e6eb0ab21dcacf532bd.png)

You should be able to do something similar and just change the “NonConfNum” part to the desired epibinding.

---

_[View the full topic](https://www.epiusers.help/t/setting-default-field-values/61151)._
