Monday, July 31, 2023

How to Use Retrieve Operation in Dataverse using Console Application

Introduction:


In this Blog we will see how to use Retrieve Operation in Dataverse using Console Applicaiton


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 Retrieve Operation in Dataverse

 

Copy paste the Below Code

 

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 retrieveAccount = service.Retrieve("account", new Guid("e5c5f9b6-6b2f-ee11-bdf4-002248d5d764"),
                    new Microsoft.Xrm.Sdk.Query.ColumnSet(true));

                string accountName = retrieveAccount.Attributes["name"].ToString();
                EntityReference AccountOwner = (EntityReference)retrieveAccount.Attributes["ownerid"];
            }
        }

 

In the above snippet you will see 

 

"account" --> Logical Name of the Table

"e5c5f9b6-6b2f-ee11-bdf4-002248d5d764" --> Guid of the Record

Microsoft.Xrm.Sdk.Query.ColumnSet(true) --> (true) to retrieve all the Records from the table

retrieveAccount.Attributes["name"].ToString() --> Retrieve Name of the Record from the Account Table

(EntityReference)retrieveAccount.Attributes["ownerid"] --> Retrieve Owner of the Record from the Account Table



Video : https://youtu.be/9td8eyx1hkc

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

Wednesday, June 21, 2023

How to Create Record in Dataverse - Excel Import

Introduction: 

In this Blog we will see how to import record in Dataverse using Excel.

Implementation Steps:

 

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

 

2. Choose the Table where you want to Import the Record, in my case am Choosing Account Table

 

3. Now click Gear Icon at the Top then Select Advance Settings (For Legacy)

        Else Select Table --> Open Account --> Click Export

 

4. In my Case Am Taking Legacy Mode and Select Advance Find then Select Account Table and Click Result

 

rampprakash_0-1687329207531.png

 

5. Once the Page Loaded Select Export Accounts and Select Static WorkSheet

rampprakash_1-1687329251439.png

 

6. Once the Excel Downloaded --> Open the Excel and Remove the Rows which is available and Add a New Record which you want to create in Dataverse Account Table

 

7. Now once the Record added in a Row then Save the Excel as CSV format

 

rampprakash_2-1687329349998.png

 

rampprakash_3-1687329398863.png

 

8. Once Saved Go the Point 2 Again and Select Data Management and Select Imports

 

rampprakash_4-1687329442819.png

 

9. Click Import Data at the Top of the Ribbon

 

10. Now Choose the File (Saved .csv format)

 

rampprakash_5-1687329494947.png

 

 

11. Click Next and Select Next again and Select Default(Automatic Mapping)

 

rampprakash_6-1687329537719.png

 

 

12. Select Account as an Entity and Click Next

 

rampprakash_7-1687329566617.png

 

 

13. Now the Field will get mapped successfully if it is not mapped then Map the correct fields and Click Next

 

14. Select the Owner and Select weather you want to allow duplicates or not and Click finish

 

rampprakash_8-1687329642100.png

 

15. Once done you can able to see the Status of the Record

 

rampprakash_9-1687329681646.png

 

16. Once the Status Reason is Completed you can able to see the Records in your Dataverse Environment 

 

 

That's it :slightly_smiling_face:

Wednesday, May 31, 2023

Host in Canvas PowerApps

Introduction: 


In this Blog we will see how to use Host in Canvas PowerApps


Implementation Steps:

 

In Canvas PowerApps there is an Option Called Host which Contains

  • BrowserUserAgent
  • OSType
  • SessionID
  • TenantID

1. BrowserUserAgent : This Will Show the User's Browser Agent

 

rampprakash_0-1685529895877.png

 

 

2. OSType : Type of OS 

 

rampprakash_1-1685529933795.png

 

3. Session ID: Current Session ID

 

rampprakash_2-1685529960681.png

 

 

4. Tenant ID: Tenant id (Environment ID)

             

rampprakash_3-1685530007019.png

 

 

That's it :slightly_smiling_face:

Tuesday, May 2, 2023

How to Share Microsoft Flow in Power Platform ?

Introduction:

In this Blog, we will see how to share Microsoft flow in Power Platform


Implementation Steps:

 

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

 

2. Click My Flows at the Left Side

 

3. Select the Flow which you want to Share 

 

rampprakash_4-1683026763554.png

 

4. Now Click On Share

 

5. Input the Name

 

rampprakash_1-1683026677144.png

 

6. Once User Added then Select weather the User Can be Co-Owner or not

 

7. If Co-Owner Select the Check Box at the Right Side Form

 

8. Now Click Share 

 

That's it :slightly_smiling_face:

Wednesday, April 26, 2023

How to Share Canvas PowerApps in Power Platform ?

Introduction:


In this Blog, we will see how to share Canvas PowerApps in Power Platform.


Implementation Steps:

 

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

 

2. Click Apps at the Left Side

 

3. Select the Apps which you want to Share 

 

rampprakash_0-1682505817438.png

 

4. Now Click On Share

 

5. Input the Name

 

rampprakash_1-1682505873632.png

 

6. Once User Added then Select weather the User Can be Co-Owner or not

 

7. If Co-Owner Select the Check Box at the Right Side Form

 

8. Now Click Share :slightly_smiling_face:

 

 

That's it :slightly_smiling_face:

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 Run Microsoft Flow for Every one Month

Introduction: In this Blog we will see how to Run Microsoft Flow for Every one Month. Implementation Steps:   1. Navigate to  https://make.p...