Coresuite customize - optimize
kurt vanhauwaert
Hi all,i have a rule that is triggerd on change_value on the invoice form, detail grid to change the value of the total price. The handling type is set on the value_changed. when the rule is triggerd the value is changed but after a few seconds the old value returns in the field. Can somebody tell me how to deal with the problem so the new and correct value is displayed on my screen. The strange thing is when i click in the changed field the correct value is displayed again. Sometimes when i quit the field again the value stays or is changed again. Here is my code :
Try
Dim lnCurrentRow As Integer = 0
Dim lcUnitPrice As String = ""
Dim lnUnitPrice As Double = 0.00
Dim lnValuta As String = ""
Dim lnQty As Double = 0.00
Dim lnKorting1 As Double = 0.00
Dim lnKorting2 As Double = 0.00
Dim lnKorting3 As Double = 0.00
Dim lnUnitPriceNaKorting As Double = 0.00
Dim lnTotaalNaKorting As Double = 0.00
If NoDiscountCalculation = True Or SpecialPrice = True Then
Return True
End If
pval.Form.Freeze(True)
lnCurrentRow = pval.Row - 1
lcUnitPrice = Matrix.GetFromUID(pVal.Form, "38").GetDisplayValue("14", lnCurrentRow)
lnUnitPrice = iif(lcUnitPrice = "", 0.00, lcUnitPrice.Substring(0, instr(lcUnitPrice, " ")))
Dim eerste As Double = instr(lcUnitPrice, " ")
Dim tweede As Double = lcUnitPrice.Length - instr(lcUnitPrice, " ")
lnValuta = iif(lcUnitPrice="", "", lcUnitPrice.Substring(instr(lcUnitPrice, " "), tweede))
lnQty = Matrix.GetFromUID(pVal.Form, "38").GetDisplayValue("11", lnCurrentRow)
lnKorting1 = Matrix.GetFromUID(pVal.Form, "38").GetDisplayValue("U_DS_Korting1", lnCurrentRow)
lnKorting2 = Matrix.GetFromUID(pVal.Form, "38").GetDisplayValue("U_DS_Korting2", lnCurrentRow)
lnKorting3 = Matrix.GetFromUID(pVal.Form, "38").GetDisplayValue("U_DS_Korting3", lnCurrentRow)
lnUnitPriceNaKorting = CalculateDiscount(lnKorting1, lnKorting2, lnKorting3) * lnUnitPrice
lnTotaalNaKorting = lnUnitPriceNaKorting * lnQty
If lnValuta = "EUR" Or lnValuta = "" Then
Matrix.GetFromUID(pVal.Form, "38").SetValue("21", lnCurrentRow, lnTotaalNaKorting)
Else
Matrix.GetFromUID(pVal.Form, "38").SetValue("23", lnCurrentRow, lnTotaalNaKorting)
End If
pval.Form.Freeze(False)
matrix.GetFromUID(pval.Form, "38").Refresh
Catch e As Exception
MessageBox.Show(e.ToString, "ok")
End Try
Return True
Paolo Manfrin
Hi Kurt,are you sure that there are no formatted searches working at the same time or other customize rules which gets triggered at the same time?
Please disable all rules but this and formatted search and check if the issue still occours.
hth
paolo
0
Please sign in to leave a comment.
Comments
0 comments