Add decimal field to form and show calculation

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