Add decimal field to form and show calculation

I am aware in a customization how to add a decimal field to a form but a novice at the code to show a calculation.

When looking at the Sales Order Entry screen there is a summary box that shows the cost, the discount and the Miscellaneous. We need to add a field to show what the total cost would be minus the discount.
I am guessing this would be C# code on the form but no clue how to write it. The information does not have to be an Epicor field. Just one that calculates when opened.

Thanks in Advance.

You could create OnChange events on those fields that are used to calc what you want to display.

The Event Wizard won’t let you make an even on a native control. But you can make one on your newly added field, and then copy the code to create the event system for the native controls.

See:

In the event handlers for your two fields, you would calc the value you want to display, and set it in your custom control.

Thanks I will give it a try and respond back.

image001.png

Syntax is not my forte.

Do you have some examples of referencing the GUID

image001.png

Hi mate,
this is an example on PO Entry adding a view field to the form at PO details then fill it with decimal value which is a summation of releases qty

private void edvPORel_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.Row > -1))
			{
			 var currentPOLine = Convert.ToInt16(view.dataView[args.Row]["POLine"]);
		         var outQty = Convert.ToDecimal(view.dataView.Table.Compute("Sum(XRelQty)", string.Format("POLine = {0}", currentPOLine)));
				this.epiNumericEditorC1.Value = outQty;
				
			}
			else
			{
			this.epiNumericEditorC1.Value = null;
			}
			
		
	} 

HTH

1 Like

Thank You. This will help tremendously.