D365: JavaScript and Business Rule on the same field


JavaScript executes first and then the Business Rules ….

Ajit Patra

Recently, on change of value of a field, we had business rule earlier and then we decided to perform the same using JavaScript to avoid hard coding of value in Business rule. The logic was to set value of 2 other fields on the form based on the value selected.

The logic was working fine on DEV as we had deactivated the business rule. However, after deploying to TEST and UAT, it stopped working.

We verified that the JavaScript event handler was enabled for the OnChange event of that field.

bb

While debugging the code as well using browser console, we checked that the break point was hitting the code block where we were setting the value of 2 other fields.

aa

After struggling for few minutes, it came to our mind that Business rule was also written which should have been deactivated.

cc

The business rule was basically clearing the values of…

View original post 82 more words

Advertisements

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.