Announcements
No record found.
when say x,y values are opted on A field than B field should be required.
*This post is locked for comments
I don't think that is possible with c#, instead you can use Business rule which is OOB functionlity of CRM.
If you find it helpful, Please mark as Verified.
Thanks,
Shahbaaz
Please check below link for making field mandatory
community.dynamics.com/.../using-business-rules-to-hide-fields-and-make-them-required-as-needed
Hi,
would you mind to elaborate? Why you need to use c# code.
You can easily to achieve this using business rule or JS.
You can easily make business required field by Using Business rules. Why C# code if CRM providing you a best way without writing piece of Code
Hi Sandy,
I understand your requirement but dynamics CRM does not support server side code to attached in the page level. Plugins we have but its not like so flexible use in page level , I mean if you did any operation in the page lets say "on change" you are setting some value using C# , you need to refresh the page to get reflect in UI and its depends on some events , operation to get trigger the business logic.
So there is easy way you can achieve your requirement using business rules , you can compare with same entity field and based on value you can set other field value , requirement level , show ,hide in client side and server side as well without writing single line of code . Here is msdn reference for business rules.
technet.microsoft.com/.../dn531086(v=crm.6).aspx
Now yo may ask if you want to validate with other entity ,then also you can achieve using java script simply fetch the data usnig Xrm.WebAPI and depending on that you can set your field value or business requirement in your form field.
You dont need to refresh your page . Here is the reference how to retrieve the data using JavaScript.
community.dynamics.com/.../ms-crm-2016-web-api-operations-retrieve-single-or-multiple-records
Hope this helps you to achieve your requirements.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
JS-09031509-0 3
AS-17030037-0 2
Mark Eckert 2