Answered by:
Questions from a frustrated developer please

Question
-
Sorry about the header. I hope our Software architect who was tasked to create a wrapper class for CRM service methods is reading this and think about how he "fakes" delivering what was expected of him only to delegate the task to the developer.
I was supposed to use a "wrapper class" but now ended up using the IOrganization from CRM directly in my code to write to ContactBase table (well, that's the only table that I can see being updated when I used the Create service method)
Please bear with me and I'm asking for your patience, I was thrown into this project like a lamb being thrown to a lion's den.
My questions:
1. What are the ENTITIES in CRM
2. I believe each of these entity has under it a number of tables, what are those if yes?
3. What is an attribute and why does a column name in a table like ContactBase not equal to attribute?
4. I don't have access to any CRM front-end, so how do I know all these attributes that are available?
5. I know by calling the service methods, the plugging under the hood is automatic, but what if I want to create a complex query to access any particular table?
5. WHY IS CRM LIMITED TO JUST A HANDFUL OF SERVICE METHODS, like create, update, insert, delete and retrieve/retrievemultiple?
6. Sorry for caps in #5, I'm emphasizing it, really. What's going on under the hood when calling a service method, how does it know what tables to update? I only use SQL profiler to check.
7. Last, do I need to take a CRM course to understand all of this to integrate CRM code to our company code, or do you think asking the forum and googling will suffice?
Thank you and I'm hoping for your patience. Just really frustrated how the project team thinks throwing this development project to a developer with zero CRM knowledge would take a day or 2 to complete development for a CRM project that would entail using all the service methods to update CRM tables. I rest my case if you think I'm just too thick not to understand CRM development in a day or 2.
Thanks again.
Thursday, March 27, 2014 8:49 AM
Answers
-
Hi LayneDad,
Feel sorry for you. But cheer up and let's get to the answers! Hopefully this will clear out your doubts and we are here to help, so no worries! :)
1. Entities in CRM can basically be compared to tables in Databases. Don't start comparing yet, because you'll find some differences. Entities in CRM are basically containers that are used to hold records of a type, say for example Contact records in Contact entity, Account records in Account entity. Also, the entities can be related to each other in a similar way as how tables in Databases have foreign-key references (except for the fact that if you look into the database you won't actually find those relationships since they are enforced in the application layer code).
2. Yes, if you went into the database, you'll find that for each entity in CRM, there are two tables in the database, the EntityBase and the EntityExtendedBase. For example Contact entity will have two tables ContactBase and ContactExtendedBase. The Base table holds the default fields of an entity, and the ExtendedBase tables holds the extra fields that you might have added for your needs. One thing to be mentioned here is that when you create an Entity from CRM frontend, the application layer creates these two tables in the database and fills them up with some default fields, in addition to which you can always add yours. Also, each Entity in CRM has a View in the database called as EntityFillteredView, like ContactFilteredView and it is recommended if you have to generate some reports directly from CRM use the View instead of the tables. The View combines both the Base and ExtendedBase tables to give all fields.
3. An attribute of an Entity is actually a column name in the database table. But what you see in the database table is the logical name of the attribute. Now, each attribute has two properties (as you might consider); the display name like "First Name" and logical name "firstname". Note how the logical name has no spaces. This logical name is what you see in the database. There is a separate table in CRM database that holds the metadata that has a mapping between the display name and logical name; so when you open up CRM front end, the mapping is fetched in the application layer and hence the data from the table.
4. Well, that's something you SHOULD HAVE! Ask the concerned person to give you the access. I mean without the access, you're going to have a tough time deciphering what attributes are there in each entity. You can find it out from the database, but it's going to be difficult and why do it that way. Microsoft NEVER recommends you to touch the database; always use CRM exposed web services and the front end.
5. CRM has various web service methods exposed, and almost always every requirement that you have can be achieved through these methods. The methods CRM has exposed are the Discovery Service (to discover CRM organisations), Data Service (to perform data oriented operations like create, update, fetch, delete, etc.) and the Metadata Service (to modify metadata of entities like adding a new attribute to an entity, etc.) Have a look here for the details. If you're looking to create a complex query, you can do it using the CRM methods. Have a look here and here for the list of methods available. Also, I would recommend downloading the CRM SDK (CRM 2011 SDK or CRM 2013 SDK).
5 (again). CRM has a lot of other methods other than the ones that you listed. Visit the links I provided and you should get an idea. Also, the SDK here is really really helpful; so download it and go through the .chm file.
6. Once you invoke a CRM web service method, the web service does the job of inserting data into the respective tables. You don't even need to worry about that. It's internal stuff and Microsoft recommends you never do modifications in the database directly. If the data was properly inserted, you should receive a response or sometimes no response after invoking the method. But if it fails due to some reason, you are going to get an exception, so you know your code didn't work.
7. Well, you don't exactly need a CRM course, but it would be a great thing to have someone give you the basic ideas of CRM, and help you a bit initially with the code. Also, there are tons of blogs, youtube videos and articles that you can read to grasp CRM. But like I said, a initial help would be a great one.
CRM is not difficult to grab, definitely not as a developer if you're from the .NET background (even if you have basic knowledge). But it does take some time for anyone to get a strong grip. I wouldn't mean to discourage you, but picking up CRM in 2 days is definitely not the way to go! But having said, I really appreciate you trying to get into it and learn about it. Any questions, just ask!
Cheers!
Admin QuikView Solution for CRM 2013
- Edited by Anupam Bishui Friday, March 28, 2014 9:42 AM
- Marked as answer by LayneDad Tuesday, April 1, 2014 7:21 AM
Thursday, March 27, 2014 10:36 AM
All replies
-
Hi LayneDad,
Feel sorry for you. But cheer up and let's get to the answers! Hopefully this will clear out your doubts and we are here to help, so no worries! :)
1. Entities in CRM can basically be compared to tables in Databases. Don't start comparing yet, because you'll find some differences. Entities in CRM are basically containers that are used to hold records of a type, say for example Contact records in Contact entity, Account records in Account entity. Also, the entities can be related to each other in a similar way as how tables in Databases have foreign-key references (except for the fact that if you look into the database you won't actually find those relationships since they are enforced in the application layer code).
2. Yes, if you went into the database, you'll find that for each entity in CRM, there are two tables in the database, the EntityBase and the EntityExtendedBase. For example Contact entity will have two tables ContactBase and ContactExtendedBase. The Base table holds the default fields of an entity, and the ExtendedBase tables holds the extra fields that you might have added for your needs. One thing to be mentioned here is that when you create an Entity from CRM frontend, the application layer creates these two tables in the database and fills them up with some default fields, in addition to which you can always add yours. Also, each Entity in CRM has a View in the database called as EntityFillteredView, like ContactFilteredView and it is recommended if you have to generate some reports directly from CRM use the View instead of the tables. The View combines both the Base and ExtendedBase tables to give all fields.
3. An attribute of an Entity is actually a column name in the database table. But what you see in the database table is the logical name of the attribute. Now, each attribute has two properties (as you might consider); the display name like "First Name" and logical name "firstname". Note how the logical name has no spaces. This logical name is what you see in the database. There is a separate table in CRM database that holds the metadata that has a mapping between the display name and logical name; so when you open up CRM front end, the mapping is fetched in the application layer and hence the data from the table.
4. Well, that's something you SHOULD HAVE! Ask the concerned person to give you the access. I mean without the access, you're going to have a tough time deciphering what attributes are there in each entity. You can find it out from the database, but it's going to be difficult and why do it that way. Microsoft NEVER recommends you to touch the database; always use CRM exposed web services and the front end.
5. CRM has various web service methods exposed, and almost always every requirement that you have can be achieved through these methods. The methods CRM has exposed are the Discovery Service (to discover CRM organisations), Data Service (to perform data oriented operations like create, update, fetch, delete, etc.) and the Metadata Service (to modify metadata of entities like adding a new attribute to an entity, etc.) Have a look here for the details. If you're looking to create a complex query, you can do it using the CRM methods. Have a look here and here for the list of methods available. Also, I would recommend downloading the CRM SDK (CRM 2011 SDK or CRM 2013 SDK).
5 (again). CRM has a lot of other methods other than the ones that you listed. Visit the links I provided and you should get an idea. Also, the SDK here is really really helpful; so download it and go through the .chm file.
6. Once you invoke a CRM web service method, the web service does the job of inserting data into the respective tables. You don't even need to worry about that. It's internal stuff and Microsoft recommends you never do modifications in the database directly. If the data was properly inserted, you should receive a response or sometimes no response after invoking the method. But if it fails due to some reason, you are going to get an exception, so you know your code didn't work.
7. Well, you don't exactly need a CRM course, but it would be a great thing to have someone give you the basic ideas of CRM, and help you a bit initially with the code. Also, there are tons of blogs, youtube videos and articles that you can read to grasp CRM. But like I said, a initial help would be a great one.
CRM is not difficult to grab, definitely not as a developer if you're from the .NET background (even if you have basic knowledge). But it does take some time for anyone to get a strong grip. I wouldn't mean to discourage you, but picking up CRM in 2 days is definitely not the way to go! But having said, I really appreciate you trying to get into it and learn about it. Any questions, just ask!
Cheers!
Admin QuikView Solution for CRM 2013
- Edited by Anupam Bishui Friday, March 28, 2014 9:42 AM
- Marked as answer by LayneDad Tuesday, April 1, 2014 7:21 AM
Thursday, March 27, 2014 10:36 AM -
Thank you, i'm getting there, almost done with what I'm trying to do, i'll just post a couple of questions in a separate thread, your information is very much appreciated! :)Tuesday, April 1, 2014 7:21 AM