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!!!

Migrate SharePoint On-Premises Content to SharePoint Online

In this article, we will discuss about Migrate SharePoint On-Premises Content to SharePoint OnlineSharePoint Online Migration PowerShell cmdlet is the a way of doing content migration without using a tool.


So, let's discuss step by step:

Prerequisites:-

  •     Azure Subscription
  •     Azure Storage Account
  •     Office 365 (SharePoint) Account
  •     SP Online Management Shell

Script:


Get-PSSnapin

Get-PSSnapin -Registered

Add-PSSnapin Microsoft.SharePoint.PowerShell

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

Export-SPWeb -Identity "<onprem-site URL e.g. http://saddamk206>" -ItemUrl "/<Document library name e.g. MyDocuments>/" -Path "<temprary path e.g. C:\Migration\MyDocuments_Source" -NoFileCompression -IncludeVersions LastMajorAndMinor

$username = "samkhan@saddamk206.co.in"

$cred = Get-Credential $username

$sourceFiles = "<Source of Files e.g. C:\Migration\MyDocuments_Source>"

$sourcePackage="<Source of Package e.g. C:\Migration\MyDocuments_Source>"

$outputPackagePath = "<Output package path e.g. C:\Migration\MyDocuments_outputPackagePath>"

$targetWebUrl = "<online sharepoint site URL e.g. https://saddamk206.sharepoint.com/sites/mypersonalsite>"

$targetLibrary = "MyDocuments"

ConvertTo-SPOMigrationTargetedPackage -SourceFilesPath $sourceFiles -SourcePackagePath $sourceFiles -OutputPackagePath $outputPackagePath -TargetWebUrl $targetWebUrl -TargetDocumentLibraryPath $targetLibrary -Credentials $cred

$azureAccountName = "<Azure account name e.g. samstorate206>"

$azureAccountKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=="

$azurelocations=Set-SPOMigrationPackageAzureSource -SourceFilesPath $sourceFiles -SourcePackagePath $outputPackagePath -AccountName $azureAccountName -AccountKey $azureAccountKey

Submit-SPOMigrationJob -TargetWebUrl $targetWebUrl -MigrationPackageAzureLocations $azurelocations -Credentials $cred


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

Saturday, 1 February 2020

Integrate a Chatbot in Microsoft Dynamics Portal

In this article, we will discuss about displaying an integration of a Chatbot inside Microsoft Dynamics portal. I am using “tawk.to” Chatbot.  So, let's discuss step by step: -

1. I have tawk.to account, so I am login this. We can create a tawk.to account here: -https://dashboard.tawk.to/signup

2. After login I can see my tawk.to dashboard, now click on the Gear(setting) icon.



3. Now we can see “Widget code” in right section, Copy it.

4. Now open Dynamics Portal and login from Admin account.

5. After login we can see the Setting section on top right.



6. Click on Edit.

7. Edit page popup window will open, now click on “Options”.



8. Now we can see three sections “Description, Custom JavaScript, Custom CSS”, put copied code inside Custom JavaScript section.

9. Remove script tags from code and Save it.

10. Now we can see the tawk.to Chatbot at the bottom right.



11. I am dropping messages here and can see inside tawk.to message section.






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

Friday, 17 January 2020

Embed a PowerApps inside Microsoft Teams

In this article, we will discuss about displaying a PowerApps inside Microsoft Teams. I have already explained another way for embedding a PowerApps inside Team of Microsoft Teams here http://saddamk.blogspot.com/2020/01/embed-powerapps-inside-microsoft-teams.html


Now we are going to try another way, So, let's discuss step by step: -


1. Open https://make.powerapps.com/
2. Click on “Apps”.
3. Select an app, here I am selecting an already created app with the name “Service Desk”. We can create an App here https://make.powerapps.com/  with the help of https://docs.microsoft.com/en-gb/powerapps/maker/index
4. Now click on three dots and select “Add to Teams”.


5. A prompt will open, so now click on “Download App”.


6. The app is downloaded as a zip file at the browser download location.
7. Now Open https://teams.microsoft.com/.
8. Click on “Apps”.
9. Now Click on “Upload a custom app” and then select downloaded app’s zip file and upload it.


10. Select App.



11. Click on “Add”.



12. After adding we can see the app inside Microsoft Teams.


13. We can redirect to this app on clicking on three dots and then select our app, as shown in the below screenshot.



Sources: -

 https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/embed-teams-app

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

Thursday, 16 January 2020

Embed a PowerApps inside Microsoft Teams

In this article, we will discuss about displaying a PowerApps inside Microsoft Teams.
So, let's discuss step by step: -


1. Open  https://admin.teams.microsoft.com/dashboard

2. Click on “Teams” and then “Manage Teams”.

3. Click on “Add” and create a new Team, I have created a Team with name “Shopping”.



4. Now open https://teams.microsoft.com/ , here we can see our created team inside “Teams” of Microsoft Teams.



5. Click on Plus Icon “(+)” in “General” Channel.



6. Search “PowerApps” and select it.

7. Now it will ask for add, so add it.



8. Search already created app, select it and Save it. Here I have already created an App with name ShoppingSite. We can create an App here https://make.powerapps.com/  with the help of https://docs.microsoft.com/en-gb/powerapps/maker/index



9. Now an new tab is added in General tab with name of an App (e.g. ShoppingSite).





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


Web Resource vs PCF vs Canvas App - which of the one is used?

While started working on specific Business Requirements related to custom layout, there is a always common question that "where to star...