Sub updateQuantity(theProduct As tProduct)
zCommon.LogT("requestQuantity() theProduct = " & theProduct , "")
Dim quantityDialog2 As InputDialog
quantityDialog2.InputType = quantityDialog2.INPUT_TYPE_PHONE
quantityDialog2.Hint = "How much?"
If(theProduct.Field1<> 0) Then
quantityDialog2.Input = theProduct.Field5
End If
quantityDialog2.Show("The quantity for this product (e.g 1 item)", _
"Enter Quantity", "Save", "Cancel", "", Null)
Msgbox(quantityDialog2.Response, "") ' this is triggered together with the dialog popup. Instead of waiting to click "OK/Cancel", etc..., the result is ready immediately.
Dim quantity As Double
Try
quantity = quantityDialog2.Input
Catch
quantity = 0
End Try
'Dim quantity As Double : quantity = 5 ' if I comment out the dialogs and use constant value, my logic below works. With a dialog, it is never executed.
If(quantity <> 0) Then
theProduct.Initialize(theRecipeProduct.Field1, _
theProduct.Field2, _
theProduct.Field3, _
theProduct.Field4, _
quantity, _
theProduct.Field6)
sqlProducts.LinkIt(theProduct)
painter("RELOAD")
Else
zCommon.showError("You have to specify not-null quantity!", _
"Error")
End If