I want to use a valuable get a result from a calculation like below. The compilation was successful. But when I call the script, I got error: Exception message: Input string was not in a correct format. Please help.
Sub CalQtyOnHandMinusAlloc()
ThisForm.Variables("QtyOnHandMinusAlloc").Value = (Convert.ToDecimal(ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("DerQtyOnHand")) -Convert.ToDecimal(ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("DerQtyAllocCO"))).ToString
End Sub