Sam's Microsoft Dynamics 365 Blog

Thursday, 27 February 2020

Using of Azure Active Directory Graph API

In this article, we will discuss about How to use Azure Active Directory Graph API.

Note:- Before starting using we have to register a new app in Azure Active Directory and then need to assign Permissions, after that we are able to get Client ID, Client Secret, Object ID

Prerequisite:

i. Client ID
ii. Client Secret
iii. Object ID
iv. Azure Account User details (Username and Password)

So, let's discuss step by step:

Login to Azure AD: -


{
"name": "Login",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "client_id",
"value": "036d42bc-2b3f-41da-a302-29d09eac37eb",
"type": "text"
},
{
"key": "client_secret",
"value": "k=dZOh.RZL[0334j:A=Tx.K5bVMEx:.G",
"type": "text"
},
{
"key": "username",
"value": "sam@saddamk206.onmicrosoft.com",
"type": "text"
},
{
"key": "password",
"value": "Pak11929",
"type": "text"
},
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "resource",
"value": "https://graph.microsoft.com",
"type": "text"
},
{
"key": "scope",
"value": "openid",
"type": "text"
}
]
},
"url": {
"raw": "https://login.microsoftonline.com/78a74a06-7d8f-4205-95ca-836e6937e795/oauth2/token?",
"protocol": "https",
"host": [
"login",
"microsoftonline",
"com"
],
"path": [
"78a74a06-7d8f-4205-95ca-836e6937e795",
"oauth2",
"token"
],
"query": [
{
"key": "",
"value": null
}
]
}
},
"response": []
}



New User Registration:


{
"name": "create",
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-type",
"value": "application/json",
"type": "text"
},
{
"warning": "This is a duplicate header and will be overridden by the Authorization header generated by Postman.",
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "\r\n{\r\n  \"accountEnabled\": true,\r\n  \"displayName\": \"sam khan\",\r\n  \"mailNickname\": \"sam\",\r\n  \"userPrincipalName\": \"samk1@saddamk206.on microsoft.com\",\r\n  \"passwordProfile\" : {\r\n    \"forceChangePasswordNextSignIn\": true,\r\n    \"password\": \"Pass@word1\"\r\n  }\r\n}\r\n\r\n\r\n"
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/users",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"users"
]
}
},
"response": []
}


Edit User Details:


{
"name": "Edit User",
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "PATCH",
"header": [
{
"key": "Content-type",
"value": "application/json",
"type": "text"
},
{
"warning": "This is a duplicate header and will be overridden by the Authorization header generated by Postman.",
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "\r\n{\r\n \"givenName\": \"sam\",\r\n    \"jobTitle\": \"Dynamics Architect\",\r\n     \"mobilePhone\": \"9988776600\",\r\n    \"officeLocation\": \"India\",\r\n    \"preferredLanguage\": \"en-us\",\r\n    \"surname\": \"Khan\"\r\n}\r\n\r\n\r\n"
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/users/57e64c5f-cf09-4b85-be69-a589057d4a34",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"users",
"57e64c5f-cf09-4b85-be69-a589057d4a34"
]
}
},
"response": []
}


Update Password:

{
"name": "Update password",
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "PATCH",
"header": [
{
"key": "Content-type",
"value": "application/json",
"type": "text"
},
{
"warning": "This is a duplicate header and will be overridden by the Authorization header generated by Postman.",
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": " {\r\n   \"passwordProfile\": {\r\n                \"forceChangePasswordNextSignIn\": false,\r\n                \"password\": \"mQht3Wthnj2\"\r\n            }\r\n    }"
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/users/57e64c5f-cf09-4b85-be69-a589057d4a34",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"users",
"57e64c5f-cf09-4b85-be69-a589057d4a34"
]
}
},
"response": []
}


Get License:


{
"name": "Get license",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-type",
"value": "application/json",
"type": "text"
},
{
"warning": "This is a duplicate header and will be overridden by the Authorization header generated by Postman.",
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/a4cb01c0-f5d2-4787-8cbf-9726cdd8466c/subscribedSkus",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"a4cb01c0-f5d2-4787-8cbf-9726cdd8466c",
"subscribedSkus"
]
}
},
"response": []
}


Assign License:


{
"name": "assign license",
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-type",
"value": "application/json",
"type": "text"
},
{
"warning": "This is a duplicate header and will be overridden by the Authorization header generated by Postman.",
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n  \"addLicenses\": [\r\n    {\r\n      \"disabledPlans\": [ ],\r\n      \"skuId\": \"4b9405b0-7788-4568-add1-99614e613b69\"\r\n    }\r\n  ],\r\n  \"removeLicenses\": [ ]\r\n}"
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/users/a4cb01c0-f5d2-4787-8cbf-9726cdd8466c/assignLicense",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"users",
"a4cb01c0-f5d2-4787-8cbf-9726cdd8466c",
"assignLicense"
]
}
},
"response": []
}


Enable-Disable User Account:


{
"name": "Enable-Disable User Account",
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "Bearer <Token>",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n    \"accountEnabled\": true\r\n}",
"options": {
"raw": {
"language": "javascript"
}
}
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/users/655f60c8-66db-4c7c-a87b-76680e7f89a7",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"users",
"655f60c8-66db-4c7c-a87b-76680e7f89a7"
]
}
},
"response": []
}




Thanks for reading the article. Hope this Article will helpful for you. Cheers!!!

Wednesday, 26 February 2020

Add a Calculated Date on a Date Field with Workflow

In this article, we will discuss about How to add a Calculated Date on a Date Field with Workflow.

Here I am going to create a new workflow that will trigger on email activity record creation. And it will create a Task with Actual Start Date and Actual End Date. In Actual Start date I will put Current record creation date and in Actual End Date I will put 1-month later date.

So, let's discuss step by step:

1. Create a new workflow e.g. I have created on Email new record creation.

2. Add a step e.g. I have created a new Task in step.




3. Select a Date field e.g. I have selected a field “Actual End”.

4. I want to add 1-month later date, so I am Selecting below Values in Form Assist

   • “Month as 1”
   • “After”
   • “Email” and “Created On”
                       


                        
5. Then click on Add.




6. I am also putting Created on Value inside “Actual Start”.

7. Save and Activate the Workflow.

Now i am going to create an Email record.

After create an Email record, workflow has created a new Task and it is working fine with date values.


Thanks for reading the article. Hope this Article will helpful for you. Cheers!!!

Friday, 21 February 2020

Digital Signature Solution for Microsoft Dynamics CRM



In this article we will discuss about Digital Signature Solution Integration Created by me.

For boosting your business, close deals faster and secure using “eSignly Dynamics CRM Solution”.

Sign your business documents from eSignly inside Dynamics CRM.

eSignly for Dynamics CRM Solution enables you to sign, track and review contracts, agreements and other business documents directly from your Dynamics CRM environment within the Leads, Opportunities and all other important entities as per your choice. eSignly for Dynamics CRM Solution helps you to keep your business digital.




Key Features

 Self-Signature or Send for Signature
eSignly provide feature to for self-sign documents or send the documents for the signature of your Dynamics CRM or Integrated SharePoint’s documents. Also, eSignly provide a multiple signature hierarchy.




Instant Requested Documents Status Checker
eSignly for Dynamics CRM Solution provides a feature of checking documents status on instant basis inside Microsoft Dynamics CRM.
   
Track and Manage Document automatically
eSignly for Dynamics CRM Solution tracks status of your sign requested documents automatically and Automatically attach signed documents.

Manage Role based access for Users
eSignly for Dynamics CRM Solution provides a role base access for Documents Signature.   Admin can manage permissions for documents signing process for Microsoft Dynamics CRM Users, using Dynamics CRM Security module.



Screens:-

Configuration of entity:-


Document selection:-



Signing documents:-

       

Signed documents inside Dynamics CRM:-




Thanks for reading the article. Hope this Article will helpful for you. Cheers!!!

How to Get the Power Automate Flow Run URL Using Expressions

In many Power Automate projects, especially those involving approvals, error handling, or audit logs, it’s helpful to have a direct link to ...