Answer the question
In order to leave comments, you need to log in
How to put data from the application into MS Dynamics CRM?
Good day,
There is an online application that should tell the CRM about the order data (payment status, etc.).
What is the best way to record this information in CRM?
Is it possible to write directly to the database?
Answer the question
In order to leave comments, you need to log in
It depends on what version of CRM and where you have it stored. Directly writing to the database is highly discouraged. When performing any action in CRM, it creates a bunch of other records in other tables.
On this forum you can find information on your question. Here you can see how to create, delete, update records in CRM 2015 with undefined entities, with predefined ones here .
The answer to most questions is easily found on the Microsoft Developer Portal .
Here is a sample code from Stackoverflow:
// retrieve and modify a pet...
Guid findId = new Guid("6CA57D73-30CC-E111-B155-00505630052F");
ColumnSet attributes = new ColumnSet(new string[] { "name", "foodtype" });
// try to retrieve
pet = xrm.Retrieve("pet", findId, attributes);
if( pet!=null )
{
Console.WriteLine( String.Format( "Retrieved pet {0} successfully!", pet["name"].ToString() ));
// update attributes
pet["foodtype"] = "Seaweed";
xrm.Attach( pet );
pet["foodtype"] = "Seaweed";
xrm.UpdateObject( pet );
xrm.SaveChanges();
xrm.SaveChanges();
Console.WriteLine( "Done!" );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question