Hello Sumaira,
- You can show /hide fields in Dynamics CRM using JavaScript , Business rules , Field level security.
Record-level permissions are granted at the entity level, but you may have certain fields associated with an entity that contain data that is more sensitive than the other fields. For these situations, you use field-level security to control access to specific fields.
The scope of field-level security is organization-wide and applies to all data access requests including the following:
- Data access requests from within a client application, such as web browser, mobile client, or Microsoft Dynamics 365 for Outlook.
- Web service calls using the Dynamics 365 Customer Engagement Web Services (for use in plug-ins, custom workflow activities, and custom code)
- Reporting (using Filtered Views)
Every field in the system contains a setting for whether field security is allowed. You can view this in the field definition from Solution Explorer. In Solution Explorer expand Entities, expand the entity that you want, select Fields, and then open the field that you want. If Enable can be selected, the field can be enabled for field security.
Although most attributes can be secured, there are system attributes, such as IDs, timestamps, and record tracking attributes, that can't. Below are a few examples of attributes that can't be enabled for field security.
ownerid, processid, stageid, accountid, contactid, createdby, modifiedby, OwningTeam, OwningUser, createdon, EntityImage_Timestamp, modifiedon, OnHoldTime, overriddencreatedon; statecode, statuscode
You can view the entity metadata for your organization including which fields can be enabled for field security, by installing the Metadata Browser solution described in Browse the Metadata for Your Organization. You can also view the metadata for an uncustomized organization in the Office Excel file called EntityMetadata.xlsx included in the top-level folder of the SDK. Download the SDK
Else-
You can make the feild visblity false by default and on page load write script to retrive logged in user security role and show/hide the feild accordingly (I would not recommand this apprcoh due to security concern)
Hope the above information will help you to fullfill your requirement.
Please have a look into community.dynamics.com/.../role-based-forms
If found useful, please mark the answer as verified