Tuesday, November 29, 2011
Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type '....'
Wednesday, November 16, 2011
CRM 4 to CRM 2011 Javascript Converter
Wednesday, August 10, 2011
Example of CCA Hosted Web Application with Bing Search
Requirement
Integration Points:
Implementation
Create Hosted Web Application
Get Control Value
Control Finder
Find the control “Search Text”, which will be identified by binding that was generated by inspector, at Bing Search hosted web application.Set Control Value
Execute Control Action
Sunday, July 17, 2011
Gallery Feature to CRM 2011
One of the requirements that you may need to deal with is, when you develop public facing CRM web portal, showing gallery of images of products, equipment and so on. So how we can add gallery feature to web portal using out of the box CRM functionality? What about if used note section of an entity to attach the images? One of the limitations of note (annotation) entity is, it is not customizable entity. Why we need to customize the note entity? Because we need to identify the attached note images, which need to be displayed on web. Otherwise web portal shows attachments, which were added for other purposes by the user. Proposed solution to handle that situation is having intermediate entity to attach images.
Download Componant
Features of the solution
• Can be plugged this with any entity with 0 code changes.
Note: When you create one to many relationship between your entity and new_Gallery, you must name the lookup field name as "<publisher prefix><entity>id". Publisher Prefix has been set to “new_” in constant class.
• There is back end plugin to copy the images, which will be added to note section of Gallery entity, into the image folder of your web portal. Plugin will remove the image from the web portal, when you removed that image from the CRM note section.
Configuration for testing
• Import CRM solution, which is located at “..\CRM2011.Galleries\CRMSolution”
• Edit EntityName and EntityId properties of the control reference at default.aspx as required.
<uc3:viewgallery id="ctrlViewGallery" entityid="C21106C1-B491-E011-8551-0800270D5292" entityname="product" runat="server"></uc3:ViewGallery>
• Edit App setting values at web.config as required.
<add value="http://localhost" key="CRMServiceUrl"></add>
<add value="OrganizationName" key="CRMOrganizationName"></add>
• Edit below app setting value as required and then add it into the app setting section of web.config of CRM 2011
<add value="C:\ MyBlog\CRM2011.Galleries\images" key="WebPortalImagePath"></add>
• Deploy plugin “CRM2011.Galleries.Plugins” using solution located at CRM2011.Galleries.Plugins\Solution
• Set AppPool to run the web application with required credential to access CRM service.
• Give read write access level permission to CRMAppPool user for the image folder of the web portal.
Then you are good to go.
--Thushara Manchanayake--
http://dynamicscrmhelper.blogspot.com
Monday, February 21, 2011
Default values of Status and Status Reason attributes
Default Values of Status and Status Reason Attributes.pdf
--Thushara Manchanayake--
http://dynamicscrmhelper.blogspot.com/
Sunday, February 20, 2011
Different Between MS CRM 4.0 and MS CRM 2011 for Java Scripting
Thursday, January 20, 2011
How to write complex quires to get the data from MS Dynamic CRM 4.0 using web service.
Traditional CRM Query Attribute cannot be used to create complex queries and get the data from many entities using joins. Query attribute has ability to join many entities, but there is no way to get the data from few entities using single query. So we should go for Fetch XML.
When we wanted to generate complex queries then fetch XML also become complex. So then we think of way to generate XML using tool. I found nice tool “Fetch XML builder”, which does everything for me. It was the first tool that I found for MS CRM 4.0 and is a very simple user friendly tool that any developer can use it without any help.
--Thushara Manchanayake--
Uploading CRM data from one CRM server to another.
Hey… another cool thing that I found in MS CRM 4.0 is this.
Problem Definition:
We need some custom entity to hold configuration data especially when you wanted to develop public facing web portal which uses MS CRM as back end. Then we should upload those configuration data to QA, Staging or Production at the deployment process. Out of the box customization import process won’t be a benefit, since it only imports entity schema, form customization, views and pick list data. And also data import tool available in out of the box CRM cannot be used, when we have complex configuration data such as XML and HTML and so on. So we should think of some custom development or a tool that handles complex data.
Solution:
There were many tools in the internet, that uses excel sheet to import and export data. They were not suitable to my requirement since I have complex data. Importing and exporting complex data from and to excel sheet (comma separated) breaks in the middle. So I thought of way to connect to CRM server and import those data into the grid and connect to the target server and export those data to target server.
I found great tool "Microsoft Dynamics CRM Bulk Update and Export tool" developed by “OrbitOne”, that has grid to hold imported data. But that tool also has no ability to import those data into the grid and connect to another server and export those data. But it has ability to load data into the grid from CRM and edit them on a tool and save back to the same server. Wow…. it was great opportunity for me to customize that in a way that it provides my requirement.
So what I did was load the data into the grid and added button “Change Connection” to launch the logging window, which has connection information to connect to CRM, to change connection to target server. Out of the box tool only has ability to load the data at edit mode. So I added another button “Get from CRM Create Mode” to load data at create mode.
Download Customized Tool (exe)
Download Customized Source Code
To download the file you must agree to the following license. | |
---|---|
- Run OrbitOne.CRMUpdater.exe
- Provide web service connection info to connect to your source environment.
- Select entity.
- Select view.
- Click "Get from CRM Create Mode".
- When data are loaded into the grid then click "Change Connection".
- Provide Connection info of CRM to where you need to upload data.
- When connection was successful, click “Export to CRM”.
Note: If you are exporting foreign keys, target server should have same keys in foreign key reference entity as the source server.
-Thushara Manchanayake-
Monday, January 10, 2011
Limitation encountered in MS dynamic CRM 4.0
- Updating CRM attribute type won’t reflect on target entity at import process on another environment.
Actually CRM won’t allow us to update existing entity attribute type and only way to do this is, drop that field from entity and add it back with new attribute type.
As example if you add property “new_field1” back to the entity “SalesOrderDetail” with Bit, where it was initially as decimal, when you import that customization to another environment(to production from development or development server to another development server,..), you will get bellow error at import process and it will log this error at event log.
Customization Import failed. Error: Column names in each table must be unique. Column name ' new_field1' in table 'SalesOrderDetailExtensionBase' is specified more than once.
In order to do this, first you must drop that column from target entity in target environment manually.
- Some of the important entities are not customizable.
Examples:
I. ServiceAppointment (CRM 2011 allow as to customize this entity)
Many of the real world implementations of MS CRM 4.0 want to associate ServiceAppointment with sales detail or sales order since there could be some items that will be sold with service activity (example: Meeting room booking with some catering items). Since ServiceAppointment is not customizable, implementation of this requirement is not straightforward
II. Announcement (BusinessUnitNewsArticle)
You may want to display announcements on public facing CRM web portal and need to add custom attribute such as new_DisplayOnWebsite to have some control over the announcements to display on public web site. We are unable to do that, since it is not customizable entity. (This required functionality can be handled using simple custom entity something call “new_PublicAnnouncements”)
III. Est..
- Out of the box CRM tax calculation won’t work for real environment.
Out of the box CRM is having just free form text box for tax and we need to calculate tax manually and enter it on text box at the order. It won’t allow us to manage several type of tax and need to develop new custom tax module on CRM using custom entities.
- Alter entity won’t reflect on target environment at customization import process.
Dropping attributes (Fields) and entities won’t reflect on target environment at normal customization import process. We should do it manually or need to think about some custom development using CRM metadata web service.
- CRM 4.0 online does not have ability to deploy plug-ins (This has been addressed by CRM 2011)
- CRM 4.0 won’t allow us to manage conflicting scenario of customization.
Most elements of CRM customization only support last one wins resolution strategy. So customization done by some can be override by another one
These are the limitations that I have encountered and in my mind right now. So there could be few more.
--Thushara Manchanayake---