Hi
We have subscribed to a phone verification service and integrated it with Dynamics 365. Basically it is an async web service which is called whenever the phone number is changed. As it physically verifies the phone line it can take a couple of seconds to return a result. We have Javascript that executes the web service call and presents a confirm message if the phone number is not verified. We store the verification state in a separate attribute.
If the phone number is not verified we are using a Business Rule Recommendation to provide a visual reminder that the phone number is not verified, so anyone dealing with the contact can reconfirm that their phone details are correct.
The problem I have is that due to the execution order of Business Rules and JScript the business rule will display the recommendation while the service is verifying the phone number but the recommendation remains remains even after the JScript web service call returns a positive result.
So to recap this is the execution order assuming a blank phone number.
1) Business rule checks if the verification state is verified and phone number is populated, displays a recommendation if not.
2) User corrects the phone number, triggers OnChange event of the phone number control
3) OnChange executes the verification service
4) verification service returns a result and sets the verification state
Unfortunately the Business Rule will still display the recommendation, so is there a way to force the Business Rule to re-execute without forcing the form to save?
To solve this problem I have added a formcontext.data.entity.save(); which works but can be annoying for the user.
The only reason for using a Business Rule Recommendation is to provide a visual prompt without the need to display the verification status on the form, which has implications for the design of the form in the UCI. I am happy to remove the business rule if there is a supported way of providing a visual indication like changing the font color of the field label or phone number in JScript.
Appreciate any feedback,
Cheers
Alan