web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :

How to Use Create Operations in Microsoft Dataverse or MSCRM

Ram Prakash Duraisamy Profile Picture Ram Prakash Duraisamy 5,753 Super User 2026 Season 1

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 🙂

 

 

Comments

*This post is locked for comments