Hi,
What is the best way to show a read only "Field1"(eg:Yes/N0) as Yes flag on CRM form only if "Field2"(Eg:Date Field) gets updated through code.
Also "Field2" is open for edit manually as well,on the Form.
*This post is locked for comments
Hi Krish,
Whatever the source of field update of date field, we can only shoe/hide fields on the forms. so on form load Business rule will trigger and hide the respective field even your scope on your particular form. But if you have more that one form you can go ahed and use All Form just to avoid multiple rules on same functionality.
Note, we have to refresh the form after data update if you are already on the form and Both the fields should be on the form.
Hi,
Our scenario is "Field2" can get updated from many sources like manually, through other referred entity etc.
Now we are going to right a dedicated console application which updates the "Field2" on demand. So if this field gets modified through this code we need set Field1 as Flag to Ture.
Else it should be "NO" which means it got modified by other means,
Hi ,
You can go with Business Rules , set scope entity as suggested above in that case your rules will work server side no matter how the field 2 get modified. Using business rules scope "Entity" you can avoid workflow or writing plugin as well , this is one of the new features in D365.
Make sure when you update field 2 via plugin you can not see immediately in the forms , for that you need to refresh the page.
Hi,
If in case Field 2 gets modified by any other means.Eg: by users manually and by Plug in etc.I need to set the "Field1" back to No as well.As per business need requested,
Hi,
Since you are updating the date field through code, whey dont you set the "Field1" to yes within the same code together?
Hi Krish,
The best way is off-course using business rules as this is no code approach and always trigger before your custom JS code register in onchange event.
Create a business rule and set the scope to "Entity" it will trigger server side.
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6