Saturday, August 23, 2025

Hide And Show The Dynamics 365 CRM Button Based On Logged In User Security Roles

 In this post I am going to explain how you will hide and show the Ribbon/Command buttons based on logged in user security rule.

I have one Delete button on one Custom entity(Employee). I have to hide this button based on logged in user security roles, for it I used the Enable Rule.

Create the java script with function as below.

function HideLeadQualifyButtonBasedOnRoles()
{
    let hasRole = false;
    let roles = Xrm.Utility.getGlobalContext().userSettings.roles;
    roles.forEach(x =>
  {
        if (x.name === "Area Manager" || x.name === "Sales Manager")
{
            hasRole = true;
            return;
        }
    });
    if (hasRole === true) {
        return true;
    } else {
        return false;
    }
}



1. Open your solution into your ribbon workbench => Select your button => click on Enable Rule => Add Step


2. Select the CustomRule and add the Function Name and Web Resource.


3. Publish your changes.


What Is Display Rule And Enable Rule In RibbonWorkbench Of Dynamics 365 CRM/CE

In this post we are going to explain what is display rule and enable into Dynamics 365 CRM RibbonWorkBench.

The Display Rule and Enable Rule are used to perform the operation into Command or Ribbon buttons.

1. Display Rule:

This Display Rule are used to hide and show the ribbon button based on FormState Rule(create, existing, read only etc.), Value Rule, Option Set Rule etc.

=> Open RibbonWorkBench tool from your XrmToolBox or Solution Ribbon.
=> Open your solution into ribbonworkbench
=> select your button
=> Click on Display Rule + icon
=> Add new Display Rule
=> Click on Add Step
=> Now you will see the below options.



2. Enable Rule:

This Enable Rule are used to hide and show the ribbon button based on FormState Rule(create, existing, read only etc.), Value Rule etc. 
You can see you have the Custom Rule option into Enable Rule, by using you can run your own rules logic.

=> Open RibbonWorkBench tool from your XrmToolBox or Solution Ribbon.
=> Open your solution into ribbonworkbench
=> select your button
=> Click on Enable Rule + icon
=> Add new Enable Rule
=> Click on Add Step
=> Now you will see the below options.



Dynamics 365 CRM/CE Command Button/Ribbon Button Customizations

In this post we are going to explain to you how to work with Dynamics 365 CRM/CE Command/Ribbon button. Sometimes you will get the requirements to Add new button on Form, Tab and Subgrid.

Following are the some scenarios where you can use this.

1. Add or Remove button on Form, Grid and Sub-grid.
2. Hide and Show the buttons.
3. Customize the existing button functionality. etc

There are two ways to work on these Command/Ribbon button.

1. Power Apps
2. RibbonWorBench


1. Power Apps: 

1.1. Go to make.powerapps.com => Apps => Select your App (in which app you want to perform the operation) => Click on 3 dot => Edit => Edit in new tab.

1.2. Now select your Entity/Table View (Here I am using Account Entity/Table) => Edit command bar => Edit in new tab => 
1.3. Select the area where you want to customize operation. Here I am going to perform operation on Form.
1.4. Click on New to add the Button and Command. Once you add the right side you can give the name and library function.


2. Ribbon Work Bench:
2.1. To work with Ribbon WorkBench you have to create the Solution and add the only Entity/Table without any components. Here We created the solution with name RibbonCustomization and added the only Account entity without any objects/components.

2.2. Open the Ribbon Workbech Tool from Solution or XrmToolBox.
       Here we are going to use RibbonWorkBench from XrmToolBox.
 

Now add the New button from left side Option => give button label and image => and Image icon(Here We are used the icon web resource of .png format)
Once you add your button you have to add the Command, Action, Enable Rule and Display Rule.

Friday, August 22, 2025

Read/Get The Dynamics 365 CRM/CE Current App Name Using Java Script

 Below code are used to get the current Dynamics 365 CRM Model Driven App Name.

Xrm.Utility.getGlobalContext().getCurrentAppName().then(

        function (appName) {

        },

        function (error) {

        }

    );


Example:
Read the current Model Driven App Name, If App Name is Sales Hub then Contact entity/table Account Name(lookup) field make the mandatory, otherwise not.

function getCurrentModelDrivenAppName(executionContext)
{
let formContext = executionContext.getFormContext();
Xrm.Utility.getGlobalContext().getCurrentAppName().then(
function (appName)
{
if (appName == "Sales Hub")
 {
   formContext.getAttribute("parentcustomerid").setRequiredLevel("required");
}
else
 {
formContext.getAttribute("parentcustomerid").setRequiredLevel("none");
 }   
},

function (error)
 {
alert("error " + error.message);
});

}


Read/Get The Dynamics 365 CRM/CE Logged In User Security Role Using Java Script

Below code are used to read/get the logged in user security roles.

let roles = Xrm.Utility.getGlobalContext().userSettings.roles;


Example:
Requirements:
Read the logged in user Security Roles and check the user is having Basic User and Sales manager roles, If have then show the Contact Job Title field otherwise hide it.


function checkRoles(executionContext) 
{
    let formContext = executionContext.getFormContext();
    let hasRole = false;
    let roles = Xrm.Utility.getGlobalContext().userSettings.roles;
    // ["AB Roles", "Sales Manager", "System Administrator"]
    roles.forEach(x => {
        if (x.name === "Basic User" || x.name === "Sales Manager") {
            hasRole = true;
            return;
        }
    });
    if (hasRole === true) {
        formContext.getControl("jobtitle").setVisible(true);
    } else {
        formContext.getControl("jobtitle").setVisible(false);
    }
}

Wednesday, August 6, 2025

What is Power Apps ?

In this post we are going to explain .

What is Power Apps?

A PowerApps is a low-code application development platform from Microsoft that enables users to create custom business applications without extensive coding knowledge. 

It is part of the Microsoft Power Platform, designed to help businesses automate processes, integrate with various data sources, and build interactive, user-friendly apps quickly. 

PowerApps allows users to create mobile and web apps that can connect to multiple data sources, including Dynamics 365, SharePoint, Excel, and external services etc.

Using this Power Apps you can develop and build following below business applications.
1. Model Driven Application
2. Canvas Application
3. Custom Page
4. Power Automate
5. Power Pages
6. Power BI
7. Power Virtual Agent

Wednesday, July 30, 2025

Environment Into Dynamics 365 CRM/CE And Power Apps

Environment is a container or workspace where you can create solutions, apps, tables, security roles, connections etc. Environment providing you a workspace where you can Develop, Customization and Configurations of your Business Applications.

If you want to build or develop the applications then you first need to an Environment. like Dev, Test, UAT and Production.

When new environment is created, default publisher, default solution, root business unit, default team, default OOB tables and standard security roles are created automatically.

There are multiple types of environments present in Microsoft 365.

1.     Default: his environment is automatically created for each tenant and is accessible to all licensed users.

2.     Developer: This environment is a personal space for building apps, with one provided per user who has a Developer Plan.

3.     Production: This environment is used for real business apps and data, offering high performance and reliability.

4.     Sandbox: This environment is meant for development and testing purposes, and it can be reset or copied as needed.

5.     Trial: This environment is temporary and intended for evaluation purposes, typically expiring after a set time limit.


Follow be steps to see and create new environment.

Go to make.powerapps.com = Environment => Click on Settings


Now Click on Manage => Environment => New

Now add the Name, Group, Region, Type etc. and click on save.




Difference Between Un Managed and Managed Solution

 Following the difference between Un Managed solution and Managed Solutions.

Unmanaged Solution

 Managed Solution

This is used for Development and Customizations.

This solution is finalized and ready for production package.

Fully editable at any time.

Not editable after import.

Deleting removes only the container. Components will remain in default solution

Deleting removes all components

Can be exported as managed or unmanaged

Can only be imported

Manual cleanup required

Easy to uninstall and revert changes


Rollup Column Data Types Into Dynamics 365 CRM/Model Driven App

Rollup column behavior are used to perform the operation on related tables. This operation occur from Source table to Related table.

Using it you can perform the following below operations.
1. SUM
2. MAX
3. MIN
4. COUNT
5. AVG

Open you solution => Go to table (Parent table Country) => Create New Column => Behavior (Rollup) => Save.
Here I am counting the related child table(Student Registration) total records.


Once you save the column one new window will be open. Here you have to select the Source table, Related table, Filter and Aggregation.
Here I am Counting the Child table (Student Registration) total records.





Formula Column Data Types/Calculated Filed Into Dynamics 365 CRM/Model Driven App

 In the Dynamics 365 CRM/Model Driven App Calculated Field, this Calculated field are used to perform the calculation on the column/fields and shows the result. 
But into Dynamics 365 CRM/Model Driven App Calculated Field is deprecated. 

Instead of it Microsoft give the Formula Data type. Inside the Formula section you can add your Formula. Like here I am doing the addition of two numbers.

Field Security/Column Security Profile Into Dynamics 365 CRM/Model Driven App

Field security or column level security allows us to control access to particular column. It helps in protecting sensitive information like password, Ids etc.

Field/Column Level Security allows only assigned user or team to perform the operation (Create, Update and Read) on this Field Level Security/Column security profile.

   To create view go to make.powerapps.com => Environment => Solution (Open your solution)


Open your table (Student Registration) => Columns=> Here I am select the Student Fees column.
Click on column => go down and check the check box Enable Column Security => Save

Now go to your Model Driven App and see the before Student Fees column key will be display.
Now create the Colum Security Profile.





Once you save open the newly created Column Security Profile => Edit


Now set the permission for Read, Create and Update.



Hint: You can customize it from Classic View as well.
To customize these options inside your solution-- switch to classic view:



In classic view> select field security profile > new > give it a name > field permissions > select column for which you want to create field security. And then customize create read write operations.

Tuesday, July 29, 2025

What Is View In Dynamics 365 CRM/Model Driven Application

 

Views in model driven apps are saved definition of how we want to show columns present in Dataverse tables. Data in Dataverse tables can be filtered, sorted based on user needs through views.

There are five types of views: Public, Quick Find View, Advance Find View, Associated View and Lookup View.

Whenever we create a new table, these 5 views are created automatically.

1.     Public view:
T
his is the primary view available to all users. we can set any public view as default.

2.     Lookup View:
It will show added columns when we select records from a lookup field.

to make changes to lookup view, go to your table>views>lookup view.

3.     Quick find view:
I
t will quickly find records from columns added in its definition in respective table.

4.     Associated view:
displays records in a Subgrid.

5.     Advanced Find view: 
It allows to search data with advanced filters.

6.     Custom view: 
We can also create customized view or customize already existing views as well.

t    To create view go to make.powerapps.com => Environment => Solution.
 


Open your table (Student Registration) => Views => New View
 

Now add the View Name, Description => Save.

Now add the Column into the View. You can drag and drop columns and you can click on View column option.

Now Validate and Save and Publish.


What Is Dot Net Framework?

In This Post , We Are Going To Explain.

⨳What is Dot . Net Framework?

⪼ Dot.NET is a software development framework designed by Microsoft to build and run applications for web, desktop, mobile, and services, providing a wide range of built-in functionalities, tools, and runtime support.”

  • Web applications
  • Desktop (Windows) applications
  • Mobile (Phone) applications
  • Web services and more.

⪼ The Dot.NET Framework provides:

  • A runtime environment called CLR (Common Language Runtime) to execute and manage applications.
  • A rich set of libraries (Framework Class Library - FCL), which offers pre-built functionality to handle common tasks like file operations, database connectivity, security, and more.
  • Cross-language support, meaning developers can use different programming languages like C#, VB.NET, and F#.

What Is C# Programming Language?

In This Post We are Going To Explain Here.

⨳ What is C# Programming Language?

⪼ C# is Pronounced as C-Sharp,

 C# is a simple, modern, general-purpose programming language. It is an object-oriented programming language developed by Microsoft. It is a safe and managed language that is compiled by the .NET framework to generate Microsoft intermediate language (machine code).

  • Web applications
  • Desktop software
  • Mobile apps
  • Games (especially with Unity)
  • Cloud-based services
  • Web Sites

Thursday, July 24, 2025

Form Security Into Dynamics 365 CRM/Model Driven App

 Form Security comes under the Security Model. Form Security means provide the security to the Form.

In this you can provide the security to Form using Security Role. Once you assigned the Security Role to the Form, only those user will be able to see the form.


Follow below step to perform the Form Security.

1. go to make.powerapps.com => select Environment => Open your Solution.


2.
Expand Your Table => Form => Select your Main Form => 


3.
Once Form open Select the Form Setting => 


4. Here in new Window you will see the two Option Under Security Tab.
    1. Everyone : The Form Will Display/Visible to everyone.
    2. Specific Security Role: The Form Will Display/Visible to only Selected Roles users.






Wednesday, July 23, 2025

How To Assign Security Role To The User Into D365/Model Driven App/

Based on Business Requirements and Needs you have to assign Security Roles to the users.


 Follow below steps to assign the Security Role to the users.

1. go to make.powerapps.com => select Environment => Click on Settings => Admin Center

2. Click on left side Manage => Environments => select your Environments => click on Settings

3. Now go to Users + Permissions => Users

4. Select the any user=> click on top Manage security roles 
5. New window open where all the Security Roles is listed. Select the required Security Roles and click on Save. Here I selected AIB Role and App Opener.







What Is Security Role In Dynamics 365 CRM/CE

What is Security Role in Dynamics 365 CRM?

A Security Role in Dynamics 365 CRM is a set of permissions that define the level of access a user or team has to various resources and functionalities within the system. Security roles help ensure data security, maintain proper workflow, and manage user actions by restricting or granting access based on business needs.

Security Role is the combination of Privileges and Access Level.

What Is Team And How To Create Into Dynamics 365 CRM/CE

Teams are the Group of users where multiples users are added. You can assign the Security Role to the Teams.

There is concept of Default Team and Custom Team.
Default Team: This team is automatically created once you created the Business Unit. This team name same as Business Unit.
Custom Team: This team is created by users or developers based on their requirements and needs.

Teams Types: There are four types of Teams.
1. Owner : Own the records.
2. Access : Used to Grant access to specific record.
3. Microsoft Entra ID Security Group
4. Microsoft Entra ID Office Group.


How to Create Team:

1. go to make.powerapps.com => select Environment => Click on Settings => Admin Center

2. Click on left side Manage => Environments => select your Environments => click on Settings

3. Now go to Users + Permissions => Teams


4. Now click on + Create Team

5. Now fill the details Team Name, Business Unit, Administrator, Team Type => Click on Next.

Now your team is ready.

Tuesday, July 22, 2025

What Is User And How To Create Into Dynamics 365 CRM/CE

Users are individuals or Single person into Dynamics 365 CRM who is having the access of Dynamics 365 CRM Environment and Organization.

There are different types of users in which based on Security Role you can differentiate like System Admin, Sales Manager etc.

User's are created from the Office 365 and Azure Active Directory. Once user are created you can add user's into Dynamics 365 CRM. See the below steps.

How to Add Users:

1. go to make.powerapps.com => select Environment => Click on Settings => Admin Center

2. Click on left side Manage => Environments => select your Environments => click on Settings

3. Now go to Users + Permissions => Users

4. Now click on + Add USer


5. Now search the user by adding the user email address. Once search complete select user and click on Add.


Hide And Show The Dynamics 365 CRM Button Based On Logged In User Security Roles

 In this post I am going to explain how you will hide and show the Ribbon/Command buttons based on logged in user security rule. I have one ...