Customization to Calculate and Display Sum of a Value

As a temporary workaround to an issue we have with pricing for SalesKit, I need to calculate the sum of all the Kit component DocTotalPrice field and display it using a NumericEditor control on the Quoteline form sheet.

I would like to understand what are the steps I need to do in order to get the result. I thought I could do this in c#, but I don't know where to start to access the field, and ICE2.5 book is no use for that as they don't explain enough how to use their tools (for a beginner like me I mean), so I'm lost. I'm not asking to write code for me, although it would be easier, that would not make me learn what I need. Just point me in the right direction to retreive the values I need and display the sum...

Not sure exactly what you mean by "access the field". If you are referring to the field you want to display the info in your best bet is to use the properties tab and epibind your field to one of the number fields supplied by epicor. To get the sum of all the components first get an epidataview:

Popular White Paper On This Topic

Not sure exactly what you mean by "access the field". If you are referring to the field you want to display the info in your best bet is to use the properties tab and epibind your field to one of the number fields supplied by epicor. To get the sum of all the components first get an epidataview:

For testing, I placed the code in a button clik event handler and the button and numeric editor is on the quoteLine detail sheet, but now I would like to have the code execute when the form refreshes (just like other calculations).
I tried a few form event handlers (edvSalesKit EpiViewNotification, SalesKit_afterRowChange, edvQuoteDtl_EpiViewNotification, ?) but I can't seem to find the right one to make it work.

Hi Christian - you'll want to use an EpiViewNotification event for the QuoteDtl EpiDataView. That is the trigger that tells all the EpiDataView bound objects to refresh depending on the arguments sent.

In your instance you could do it where the args.NotifyType == EpiTransaction.NotifyType.Initialize . You can try putting a message box to show the NotifyType in testing to make sure you're hitting the method when you need, it will get called a lot as a warning e.g. EpiMessageBox.Show(args.NotifyType.ToString()) .

The edvQuoteDtl.Row is a property of the EpiDataView that returns an integer value for the current active row. In this instance where the SalesKit edv is being processed that value might not be a valid table record since there isn't an active row for the QuoteDtl. You could also use edvQuoteDtl.CurrentDataRow to get the same property if that makes it easier to understand.

I'll admit I'm not familiar with the db structure for how a kit-to-quote-line relationship works, but you need to find the appropriate row integer value to pass in for the parameter rather than edvQuoteDtl.Row.

You can definitely use a try/catch statement to keep any exceptions from stopping your entry process, but I would not use them just as a way to suppress errors (it won't actually update the data anyways if you did, I'd still display the exception message in a message box).

I understand your explanation but I haven't been able to come up with a solution yet, despite trying very hard.
In the SalesKit dataView, there is a ParentKitLine field, which give the exact Line number for where I should set the Number05 field.
I thought this would work?but it didn't.

Uncomment this line:
// EpiMessageBox.Show(args.NotifyType.ToString());
and do a little testing. I believe you may find that args.NotifyType == EpiTransaction.NotifyType.Initialize fires off more times and in different places than you think. You may need to change methods to a before/after adapter method or a custom row rule.