Posts

Showing posts from 2012

CRM 2011 Kerberos Troubleshooting - Report Wizard FetchXml Related Issue

Hi all, Recently one of our clients had issue when running reports created through the report wizard. After some investigations, it turned out that the FetchXMLDataSource is having some connection issue with an error log recorded something like:  A call to SSPI failed, see inner exception. This is surely a kerberos authentication issue. After a few good hours reading documentations on how to set up proper kerberos for CRM 2011, I managed to get all working nicely. I summarised all what I've done so that it may help you down the track: Check the CRMAppPool service account whether you are using NetworkService or a domain account. The best practice is to use custom domain account (separate from your CRM admin account as well). In my case I have something like domain\CRM2011APP. If you set this up during installation it should at least be in the PrivUserGroup and PrivSqlServerGroup as well. Open your AD manager and check if that account has kerberos delegation enabled (On de

Knockout and SharePoint - Simple Example

Image
Hi All, As you all know, client side technology is powerful and I am a fan of it. Apart from being fast and no postback is required, it is relatively easy to develop compared to hefty server side code. However you should keep in mind that your code can be easily tracked and downloaded so if you have sensitive information and logic that needs to be secured then you need to use server side code :) You can do hybrid application though and that is probably the best way to go. In this example I will show you how easy to get the data out of SharePoint list and display it with a little user interactivity. This web part consists of a user control and it basically displays a land mass comparison in boxes. Most of the times people do not realize how big WA is in comparison to their own country and when they come here they find out that they need 1-2 days to get to the other region. End result will look like this: We will be using: 1. jQuery  +  Knockout 2.1.0  for the awesomen

LINQ Grouping through SelectMany - Powerful!

This is the first time I use this feature and I love it very much! What this feature does is that it flattens your object in relation to your defined selected child object. So for example, if I have a list of Item object and that object has a List  of Category  (imagine Item has N:N relationship to Category) and I want to be able to group it based on the Category and display it in such a way so it looks like this: Category 1 Item 1 Item 2 Item 3 Category 2 Item 2 Item 4 and so on.. It is easy to get that structure using LINQ! That's all you need to do! ^_^ Hope this helps, Andreas

jsRender for complex display rule

Image
Hello Everyone, So it comes to a point where I have a set of data in front of me and I want to render those data in a quick and easy way. I don't like rendering html through code behind because it is just cumbersome and hard to maintain. Also, it is not that simple to display these data because there needs to be some logic when rendering each record. This is where I thought that jsRender would be the perfect thing to use! I have used jQuery template before and  I found it quite useful but they did not continue that project. jsRender is still active in development and it is proved to be much powerful and faster (as it's claimed to be) and fortunately it is very easy to use as well. To cut things short, the sample data looks like this: Entity: CourseOutline Attribute: PathwayId (each CourseOutline can have more than 1 pathway) PathwayLineNo (1-5) EntryPoint (e.g. Year 12) Duration (duration of the Course) Product (this is the Course Product entity with Product Name

Music Website New Look! (HTML5 & jQuery)

Image
Hello All, I am excited to say that my music website  http://pianoismyfriend.com  has been refurbished and gone live! :) I built the website by myself and it was a really good personal project and it allows me to explore all different kind of tools and technology out there. It surprised me how we can leverage variety of existing services people have to offer without reinventing the wheels these days. Some technical information about the new PianoIsMyFriend website: LightCMS is used as the hosting and the content management provider. I moved away from WordPress because of the maintenance effort comparison and the different goal that I wanted to achieve. My website should be really simple with minimal plugins. I found it hard keeping up-to-date with WordPress versions and updating my plugins that break after updating my WordPress.  With LightCMS I was able to get my website up within a week and focus more into my content and   how it fits together. It provides SEO support as

JQuery & Knockout - A Simple Example

Image
Hi All, I have been assigned to do some client side stuff. In this case, we have some FAQ contents in CRM back-end and I want to  grab those content and display it in a user control. End result will look like this: We extensively use Knockout.js and jQuery in terms of displaying simple content. The advantage of this is that it renders much faster than using server controls. To grab the data we can use POST request to get JSON from the asmx webservice. Here is an example of displaying FAQCategory. Note that: 1. UPDATE - updated to knockout 2.1.0 . This will use native templating. 2. Grouping is achieved by creating pivot 'associative' array object :) 3. Notice multiple synchronous request? This is because the webservice is using RetrieveMultiple request (CRM 4.0) thus I need to grab attribute from related entity. Then I append the attributes to my result object. (can use FetchXML but more cumbersome in terms of parsing + slower than QueryExpression. Also, you can

New Songs - Blooming Or Withering Flower

Image
Which one suits your mood? :) Enjoy, Andreas

CRM 2011 LINQ Left Join Through Entity Reference

Let's say we have a custom lookup field new_accountid on our phonecall activity (don't ask me why I don't just use from/to field :)) and that field is NOT a required field. We want to get the account number using LINQ in our code somehow. This is the way to do it. The trick is that we have to check whether the new_accountid is null and combine those records with the ones that are null. Hope this helps, Andreas

CRM 2011 Get OptionSetValue Value through Label

Sometimes we want to be able to get the OptionSetValue value from the label itself. One way is to use the metadata request and loop through it but this is a cumbersome way. The easier way is to put those OptionSetValue data into an enum like this: We use Description Attribute for the Label so that it supports string format. Then we use this helper method: And there you go. You can easily get the value like this: Hope this helps, Andreas

Happy New Year 2012!

Image
Happy New Year everyone! May this year bring you good things and happiness! Take care, Andreas