Showing posts with label Microsoft Dynamics CRM. Show all posts
Showing posts with label Microsoft Dynamics CRM. Show all posts

Monday, January 29, 2024

How to use Retrieve and Retrieve Multiple using PowerShell

Introduction:


In this Blog we will see how to use Retrieve and Retrieve Multiple using Power Shell with Dataverse or MSCRM


1. Retrieve:

 

Retrieve Used to Retrieve Single Record at a Time

 

CMDLETS:

 

Get-CrmRecord

 

Sample :

 

Get-CrmRecord -conn $conn -EntityLogicalName account -Id be02caab-6c16-e511-80d6-c4346bc43dc0 -Fields name,accountnumber

 

 

account - Entity Logical Name

be02caab-6c16-e511-80d6-c4346bc43dc0 - GUID of record to Retrieve

name,accountnumber - Field from Account Table

 

 

2. Retrieve Multiple :

 

Retrieve Multiple Used to Retrieve Multiple Records at a Time

 

CMDLETS:

 

Get-CrmRecordsByFetch

 

Sample :

 

$accountFetch = @"
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> 
<entity name="account">
<attribute name="name" /> 
</entity>
</fetch>
"@

$multipleRecord = (Get-CrmRecordsByFetch -conn $conn -Fetch $accountFetch).CrmRecords

 

 

That's it :)

Friday, January 5, 2024

How to Use Dataverse Accelerator -Low Code Automated Plugin

Introduction:


In this Blog, we will see how to use Dataverse Accelerator - Low Code Automated Plugin


Implementation Steps:

 

1. Navigate to https://admin.powerplatform.microsoft.com

 

2. Open the Sales Environment

 

3. Click On Dynamics 365 Apps

 

rampprakash_0-1704438158015.png

 

4. Then Select the Dataverse Accelerator

 

rampprakash_1-1704438212462.png

 

5. Make sure its Installed

 

6. Now Navigate to https://make.powerapps.com

 

7. Click Apps at the Left Side then Select and Play Dataverse Accelerator App

 

rampprakash_2-1704438341829.png

 

8. Once the Page is Opened Click New Plug-in

 

9.  You can see 2 Options one is Instant and Another One is Automated.

 

rampprakash_3-1704438398000.png

 

10. For Today's demo we will see Automated Plugin

 

rampprakash_4-1704438487918.png

 

 

Now Fill the Details like highlighted above.

 

Now Save 

 

11. Now Open Account Entity and Create a Record 

 

12. Once the Record gets created you can see the Description Field Updated as DEMO

 

rampprakash_5-1704438593696.png

 

 

That's it :slightly_smiling_face:

Tuesday, November 28, 2023

How to Enable Copilot for end users in canvas apps

Introduction:


In this Blog we will see how to Enable COPILOT in Canvas PowerApps


Implementation Steps:

 

1. Navigate to https://admin.powerplatform.microsoft.com

 

2. Select the Respective Environment where you want to Enable COPILOT

 

3. Open the Environment

 

rampprakash_1-1701149600928.png

 

4. Click Settings on TOP --> Select Product --> Select Feature

 

rampprakash_2-1701149648231.png

 

 

5. You will see an Option Called COPILOT Enable the Option

 

rampprakash_3-1701149671598.png

 

6. Click Save

 

7. Now go to https://make.powerapps.com

 

8. Click Apps at the Left Side

 

9. Select New and Select Blank Canvas APP

 

10. Once the App Opened --> Click Settings from the top and Click Upcoming Features and Turn On COPILOT COMPONENTS

 

 

rampprakash_4-1701149795634.png

 

11. Once Done Click INSERT and You will See the COPILOT OPTION ENABLED

 

rampprakash_5-1701149856263.png

 

 

 

Note:

 

Current its based on the REGION Specific

Thursday, August 31, 2023

How to Use Delete Operations in Microsoft Dataverse or MSCRM

Introduction:


In this Blog we will see how to use Delete operations in Microsoft Dataverse or MSCRM


Implementation Steps:

 

As I mentioned in my Previous Blog you can able to follow how to use Dataverse Connection with Console Application.

 

In this Blog we will see how to use Delete Operation in Dataverse

 

Copy and Paste the below Code for Delete Operations

 

CrmServiceClient service = new CrmServiceClient(connectionString);
service.Delete("account", new Guid("a4cea450-cb0c-ea11-a813-000d3a1b1223"));

 

"account" --> Entity Logical Name

"a4cea450-cb0c-ea11-a813-000d3a1b1223" --> GUID of the Record to Delete

Friday, August 11, 2023

How to Use Update Operations in Microsoft Dataverse or MSCRM

Introduction:


In this Blog, we will see how to use Update Operations in Microsoft Dataverse or MSCRM.


Implementation Steps:

 

As I mentioned in my Previous Blog you can able to follow how to use Dataverse Connection with Console Application.

 

In this Blog we will see how to use Update Operation in Dataverse

 

Copy and Paste the below Code for Update Operations

 

Entity updateAccount = new Entity("account");
updateAccount.Id = new Guid("e0385c7b-8b32-ee11-bdf4-002248d5d764");
updateAccount["name"]= "Updated from Console Application";
service.Update(updateAccount);

 

"account" --> Entity Logical Name

"e0385c7b-8b32-ee11-bdf4-002248d5d764" --> GUID of the Record to Update

"name" --> Field Name to Update

"Updated from Console Application" --> Values to be Updated

Monday, August 7, 2023

How to Use Create Operations in Microsoft Dataverse or MSCRM

Introduction:


In this Blog we will see how to use Create Operations in Microsoft Dataverse or MSCRM environment.


Implementation Steps:

 

As I mentioned in my Previous Blog you can able to follow how to use Dataverse Connection with Console Application.

 

In this Blog we will see how to use Create Operation in Dataverse

 

Copy and Paste the below Code for Create Operations

 

 

 

static void Main(string[] args)
        {
            // Connection string to Dynamics 365
            string connectionString = "AuthType=Office365;Url=https://URL.crm8.dynamics.com/;Username=username@environment.onmicrosoft.com;RequireNewInstance=true;Password=PASSWORD;";

            // Create the CrmServiceClient instance using the connection string
            CrmServiceClient service = new CrmServiceClient(connectionString);

            // Check if the connection was successful
            if (!service.IsReady)
            {
                Console.WriteLine("Failed to connect to Dynamics 365.");
                return;
            }
            else
            {
                Entity createAccount = new Entity("account");
                createAccount["name"] = "Demo Account";
                createAccount["OPTION SET LOGICAL NAME"] = new OptionSetValue(10000);
                createAccount["ENTITY REFERENCE LOGICAL NAME"] = new EntityReference("Entity LogicalName", new Guie(GUID OF RECORD));
                service.Create(createAccount);
            }
        }

 

"account" --> Table Name

"name" --> Logical Name of field Name

OptionSetValue --> to set Drop Down Values

EntityReference --> LookUp Reference.

 

That's it :slightly_smiling_face:

Monday, July 24, 2023

How to Connect Dataverse with Console Application

Introduction:


In this Blog we will see how to Connect Dataverse with Console Application.


Implementation Steps:

 

1. Open Visual Studio

 

2. Search for .Net Framework

 

rampprakash_0-1690195194751.png

 

 

3. Select Next 

 

rampprakash_2-1690195235634.png

 

4. Input your Name and Click Create

 

5. It will Create a Console Application Project

 

6. Once Created Input the Below Code

 

try
                {
                    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                    CrmServiceClient conn = CrmServiceClient(ConfigurationManager.ConnectionStrings["Xrm"].ConnectionString.Decrypt());
                    conn = new CrmServiceClient("AuthType=Office365;Url=https://URL.crm4.dynamics.com/;Username=USERNAME;Password=PASSWORD;RequireNewInstance=True");

                    if (conn.IsReady)
                    {
// Connection Established
                    }
else{
// Connection Not Established
}

                    return conn;
                }
                catch (Exception ex)
                {
                    throw;
                }

 

7. Once you pasted above code you will get error like below (ITS because of Missing Assembly)

 

rampprakash_3-1690195604096.png

 

 

8. Right Click on the error CRMServiceClient you will get Quick Actions Select and Select Install Package Microsoft.CrmSdk.XrmTooling.CoreAssembly

 

rampprakash_4-1690195717821.png

 

9. Once Done it will automatically install all the Respective Assembly 

 

rampprakash_5-1690195762223.png

 

 

That's it :slightly_smiling_face:

 

Once done you are good to go with the CRM Connection and process.

 

Note:

 

We can use Client ID and Client Secret as well to establish Connection

Monday, April 17, 2023

How to Change Label Text in Form using JavaScript in Model Driven Apps

Introduction:

In this Blog we will see how to Change Label Text in Form Using JavaScript in Model Driven Apps.


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Click More --> Select Tables

 

3. Open the Table where you want to change the Form Text

 

In my Scenario I need to Change the Text Based on Boolean Field.

 

4. Boolean Field

  • Name : Change Text
    • Yes --> If yes then Change Text to Selected Yes
    • No --> If No then Change Text to Selected No

5. Now Create a Web Resource then Upload Below Code

 

function onChangeBooleanField(executionContext) {
    var formContext = executionContext.getFormContext();
    if (formContext.getAttribute("crd20_changetext").getValue()) {
        formContext.getControl('name').setLabel('Selected Yes');
    } else {
        formContext.getControl('name').setLabel('Selected No');
    }
}

 

// crd20_changetext --> Boolean Field Logical Name

//name --> Label to be Changed

 

6. I have Written function in OnChange of Boolean Field

 

7. Once Code Written Refresh the Account Form

 

rampprakash_0-1681723093204.png

 

As i said written Code in On Change

 

Now if i change Value to Yes then You will see Selected Yes as Label

 

rampprakash_1-1681723130587.png

 

 

Now if i change to No then You will see Selected No as Label

 

rampprakash_2-1681723649432.png

 

 

That's it :slightly_smiling_face:

 

Using Change label in JavaScript we can change the Label Text.

How to Import Data from Excel to Multiple tables in PowerApps

Introduction:   I have created a view on how to import data from excel to multiple tables in Canvas PowerApps   Implemented Steps: ...