Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation in Epocor 9 Customization

Status
Not open for further replies.

fbcarter

Programmer
May 31, 2010
1
CA
I am trying to add a customization where I have added a epiNumericEditor to a form. Based on the entry value in this control. I want to calculate the value of one of the standard controls on the form.

In particular on the Job Details page of Job Entry Module I want to calculate the following.

Dim QtyParent As EpiNumericEditor = CType(csm.GetNativeControlReference("f184f1a1-cd81-41c7-8347-2e5fc78f8703"), EpiNumericEditor)
if nbrNumUp.Value > 0 then
QtyParent.Value = 1.0 / nbrNumUp.Value
End If


I have tried this on the Leave, AfterExitEditMode, TextChanged and ValueChanged Events.
Nothing happens except in the ValueChanged Evetn where as I type the value in nbrNumUp the calculation shows and QtyParent is updated. But when I tab out of the field QtyParent reverts back to the origianlvalue. It seems that I need to not change the control value property but instead change the underlying table field.

Does any one have a solution?

TIA
Farley
 
I'm new to E9 but would like to take a try at this.

Have you tried setting the column's value directly using a DataView object within a EpiViewNotification (Add or Initialize)? I had a similar issue yesterday and binding my new form object to a UD field and using this worked for me:

Private Sub edvSalesTRP_EpiViewNotification(ByVal view As EpiDataView, ByVal args As EpiNotifyArgs)
'** 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
'Msgbox(args.NotifyType)
If (args.NotifyType = EpiTransaction.NotifyType.AddRow) or (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then

If (args.Row > -1) Then
Dim salesRepCode As String = edvSalesTRP.dataView(edvSalesTRP.Row)("SalesRepCode")
'MsgBox(salesRepCode)
If Len(salesRepCode) > 0 Then
If Len(view.dataView(args.Row)("ShortChar01")) = 0 Then
view.dataView(args.Row)("ShortChar01") = salesRepCode
End If
End If

End If
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top