I am creating a form and then calling a function and getting the system to wait. I'm calling from the form and not a service like this:
wait for (GlobalFunctions.ParseCycleCount(lJson,lSAPData)) Complete (Result As Boolean)
If Result=True Then
btnOK.enabled=True...