Hi Team,
I have to perform the CRUD operation for the different data types field present in CRM.
Suppose i have a custom field of data type "Single line of text" then for this particular type of field i should be able to insert or delete or update or retrieve the data through GUID or any other way.
Like ways i need to do for other data types of the field.
Not getting the logic and the code to proceed further.
Can anyone please help me out to get the logic and the code?
Thanks in Advance :)
*This post is locked for comments
Hello Anita,
This might help you: http://himbap.com/blog/?p=2821
msdn.microsoft.com/.../gg328416.aspx;MSPPError=-2147217396
Thanks
Hi Anita,
It should be straight forward. Below i sthe sample for create
// Create a new contact record
Entity accountEnt = new Entity("account"); // Single Line accountEnt["name"] = "Test Account"; // Owner Lookup accountEnt["ownerid"] = new EntityReference("team", new Guid("A09EAF81-B7B7-E711-8168-E0071B675C91")); // Look up to a team with this id // Currency Lookup accountEnt["transactioncurrencyid"] = new EntityReference("transactioncurrency", new Guid("C2D2DA87-A282-E711-8125-70106FA12A51")); // Look up to a Currency AUD // Option Set/ Drop Down accountEnt["customertypecode"] = new OptionSetValue(1); // Pass the integer number to optionsetvale object. 1 being competitor value // Money accountEnt["creditlimit"] = new Money(100M); // Pass the decimal number to money object. // Whole Number accountEnt["numberofemployees"] = 1000; // Pass the integer value. // Two Option (Boolean) accountEnt["creditonhold"] = true; // Pass the boolean value (true or false). service.Create(accountEnt);
To read/ update a value, you just need to use the same datatype as mentioned above in create.
To delete a value, simple set the value to null. This will empty the the value of the field
accountEnt["name"] = null;
Take a look at this for more info-
msdn.microsoft.com/.../gg334754.aspx
Hope this helps
Hi Francesco Picchi and Mihir Shah,
Thanks a lot for the response.
Will explain my scenario here:
My requirement is, I want to perform the action update or insert or retrieve or delete the data present in the field by using the console Application.
So, after creation of the field i should be able to perform all these actions on the field.
Hope my requirement is bit clear.
Thanks in Advance :)
Anita Chaudhary
Please refer to this community post:
Hope it helps!
If you found the answer helpful, please mark as Verified
Thank You & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna, ITALY
Independent Contractor
I am not sure what exactly you want to do but here are few options -
1. Use Data Import - Settings > Data Management > Imports or use Data loader
2. Use Web API calls to insert / update or retrieve data
Refer to the SDK
www.microsoft.com/.../details.aspx
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156