Writing to Db with EpiViewNotification

I am on the inspection processing form and I am trying to get data to write to the rcvdtl from the porView. The goal is when they save the PO Receipt Inspection to write to some UD fields I have created.

I used the below code thinking that this will execute when I save a PO Receipt but it does not. If I change it to NotifyType.Initialize, it executes to often.

private void edvporView_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.AddRow))
		{
			//MessageBox.Show("Hello World");
			if ((args.Row > -1))
			{
				MessageBox.Show("Hello World");
			}
		}
	}

Is there a better way to get the input from this form?

Try before or after field change.

Same thing. No message at all. just saves and goes on.

private void porView_BeforeRowChange(EpiRowChangingArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.ProposedRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
		MessageBox.Show("Hello World");
	}
1 Like

I think you are going to need to explain more.

Sorry, after i enter the information into the inspection process PO Receipt. I click save. Since I was using the beforerowchange I was expecting a message box. Same thing with the EpiViewNotification. Since this is a view and not a direct Db call, I am having trouble passing the value from the check boxes back to rcvdtl table.

I would just do this in a BPM. Client code not needed.

If it doesn’t auto refresh, worst case is you refresh it using AfterAdapterMethod.

1 Like

I will try that, I am not 100% sure how to get the InspProcessingDataSet exactly. I am guessing I will be using the InspProcessing business object.

I think I have it figured out now. I must not have restarted after I did my Data Model Regen because the fields were not showing. But they are now. Thank you for your help.