Sunday, February 17, 2013

Tool tip bug on lookup fields in CRM2011

In CRM2011 only the lookup fields have tool tips.  The tool tip generally displays “Click to select a value for fieldname” as shown in the following screen shot.

image 

The problem starts when you change the the the position of field label from side to top of the field. Before I talk about the bug, lets see “How to change the position of the labels from the side to top of the fields”. This setting is the property of “Section” Control of the entity form. Here are the steps to change the position of the labels.

  1. Double click on the section on the form.
  2. Click on the “Formatting” Tab.
  3. Scroll down and selects “Top” in the “Field Label Position” section as shown in the following screen shots.
    image 
  4. Save the changes and publish the entity. The changed section will look like the following screen shot.
     image

Bug Details

Now coming back to the tool tip behaviour. This behaviour changes based on the position of the lookup field in the section.

  1. If the lookup field is in the first column of the section. For example “Price List” field in the following screen shot. The tool tip will display “Click to select a value” without specifying the field.
    image
  2. If the lookup field is in the second column and there is any other field in the first column. For example “Territory” field in second column and “Price List” field in the first column in the following screen shot. The tool tip will display “Click to select a value for “field name in the first column”.
    image
  3. If the lookup field is in the second column and there is a optionset field in first column. For example “Currency” field in second column and “Payment Terms” field in the first column in the following screen shot. The tool tip will display “Click to select a value for “field name in the first column with all the drop down values”.
    image
  4. Similarly if the lookup field is second column and date time field in the first column then, the tooltip will behave the same way as step 3 displaying all the time slots as shown in the following screen shot.
    image


I don’t have solution to this problem. But you can minimise the impact by adding the lookups in the first column of the section.

Wednesday, January 30, 2013

CCOLA forms in Polaris(CRM2011)

Rollup 12 or Polaris is out for few weeks now. Microsoft have also release the server components for on-premise deployment today.I am playing with Polaris for few weeks now. There are a lot of new features introduced in Polaris and one of them is guided process flow forms or CCOLA forms. CCOLA forms stands for Contact, Case, Opportunity, Lead and Account  entities.These forms are available only in CRM Online at this stage.

These new forms guide the sales and customer service teams through the

  1. Sales Process (More Details)
  2. Case Resolution process (More Details)

The new forms comes with Process flow and classic form views. The following screen shots display the process flow form for lead entity.

image

image

The classic version of these forms are like original CRM forms. Some of the feature are available in both versions of the new forms. For e.g.  Bing map integration and Customer details control( Control displaying few fields customer record on case entity).

Good things about new process flow forms

  1. Guided process flow
  2. Inline editing – No more pop up windows
    image
  3. Bing map integration (for lead contact and account entity forms)
  4. Skype integration
  5. Auto Save
  6. Customer detail pane ( I really like this control. Now we can display the customer’s email and phone number on case entity)
    image

Limitations of new process flow forms

Call the following points the limitations or the scope for the improvements in future releases.

  1. Does not support java script
  2. Left Navigation functionality is limited. You can display the related records but you can’t add a new record. The only way to add new records to switch it to classic view or add the grid on the form.
    image
  3. New button will only allow you to create a new record of same type. For e.g New Button on lead entity will open up a new lead entity form.
  4. There is an option on the process flow form to switch to classic view but there is no option to switch back to process flow view.

Conclusion

This is a good start. I am hoping for a lot of improvements in near future. I would like to see the Bing map integration and customer detail pane as controls, so we can use them where ever we want in the system. Check the following link to learn about all the new features available in rollup 12.

http://rc.crm.dynamics.com/RC/2011/en-us/whatsnew.aspx?ver=5.1#BKMK_NewSales

Please leave the feed back and  add more good things or limitations to the list.

Sunday, January 13, 2013

White House’s official response to the building of death star petition.

This is my first blog that has nothing to do  with CRM. But it is very funny. Around 34435 people signed the petition to secure resources and funding, and begin construction of a Death Star by 2016. BC.  By law , White House has to respond to any petition signed by more than 25000 people. Here is the official response by White House.

https://petitions.whitehouse.gov/response/isnt-petition-response-youre-looking .

Generic solution to add missing associated views to the form navigation

This is the part 2 of my last blog Step by step tutorial to add the missing associated views to a CRM form. This blog will extend the solution to make it more generic. In the previous solution we have to add the relationship name in HTML web resource, which means  that we have to create multiple HTML web resources if we want to add multiple associated views in the system.
I have updated the solution to pass the relationship name as parameter(query string) to the HTML resource. This way we can use the same HTML web resource as many times as we want.

Here is the updated code for the HTML web resource.
 <html xmlns="http://www.w3.org/1999/xhtml" >  
 <head>  
   <title>Untitled Page</title>  
   <style type="text/css">html,body{font-family: Segoe UI, Tahoma, Arial;background-color: #d6e8ff;border: 0px; margin: 0px; padding: 0px;}</style>  
   <script type="text/javascript" language="javascript">  
       //debugger;  
       //get the context  
       var Xrm = window.parent.Xrm;  
       //get the current object id  
       var oId = Xrm.Page.data.entity.getId();  
       //get the object type  
       var oType = Xrm.Page.context.getQueryStringParameters().etc;  
       //set Relationship Name  
       var relName = getDataParam();  
       if (relName != "not found") {  
         //building a url  
         var sUrl = "/userdefined/areas.aspx?oId=" + oId + "&oType=" + oType + "&pagemode=iframe&security=852023&tabSet=" + relName;  
         //get relative path with orgname as required  
         var relativeUrl = Xrm.Page.context.prependOrgName(sUrl);  
         window.location = relativeUrl;  
       }  
       else {  
         noParams();  
       }  
       //Most of this code is from sdk dataparams example  
       function getDataParam() {    
       //Get the any query string parameters and load them into the vals array  
         var vals = new Array();  
         if (location.search != "") {  
           vals = location.search.substr(1).split("&");  
           for (var i in vals) {  
             vals[i] = vals[i].replace(/\+/g, " ").split("=");  
           }  
           //look for the parameter named 'data' and return relationship name  
           for (var i in vals) {  
             if (vals[i][0].toLowerCase() == "data") {  
               var relationship = decodeURIComponent(vals[i][1])  
               relationship = relationship.replace(/\+/g, " ")  
               return vals[i][1];  
             }//endif  
           } //end for loop  
           return "not found";  
         }//endif  
         else {  
           return "not found";  
         }  
       }// end function  
       function noParams() {  
         var message = document.createElement("p");  
         message.innerText = "No data parameter was passed to this page";  
         document.body.appendChild(message);  
       }  
   </script>  
 </head>  
 <body>  
 </body>  
 </html>  

How to call HTML web resource

  1. Add the navigation link to the form. The navigation link properties dialog will look like the following screen shot.

    image
  2. Choose the name for the navigation link.
  3. Select an icon for the link.
  4. Select  “External URL” instead of using the web resource. Use the relative path for the web resource and pass the relationship name as query string parameter as  shown in the screen shot above.
  5. Save and publish the changes and test the solution.
There you go now you can use the same HTML resource to add as many missing associated views as you want.

Sunday, January 6, 2013

Step by step tutorial to add the missing associated views to a CRM form.

In my last blog, I have posted the URL to add the navigation link for the relationships missing in the relationship explorer. I was in a hurry and did not explain how the URL can be used to add associated view to the form navigation. This blog will explain all the URL parameters and a step by step guide to achieve it.
URL Parameters
Here is the URL to display the associated view.
http://servername/orgname/userdefined/areas.aspx?oId=<guid of the entity>&oType=<entity type code>&pagemode=iframe&security=852023&tabSet=<relationship schema name>
The URL has following parameters
  1. oId: This parameter represents the guid of the entity opened in the form.
  2. oType: This parameter represents the entity type (object type code) of the entity
  3. pagemode: This parameter is static. pagemode=iframe means that this view will be displayed like an iframe and there will be no ribbon displayed for this view. The system will display a context ribbon when user selects the associated view grid.
  4. security: This parameter is also static. I am not changing this value.
  5. tabSet: This parameter represents the schema name of the relationship.
Here are all the steps to add the associated view to the form navigation.
  1. Create a HTML web resource. I named my web resource “AssociatedView.HTML”. Here is the code for the web resource.
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Untitled Page</title>
        <style type="text/css">html,body{font-family: Segoe UI, Tahoma, Arial;background-color: #d6e8ff;border: 0px; margin: 0px; padding: 0px;}</style>
        <script type="text/javascript" language="javascript">
    
                //debugger;
    
                //get the context
                var Xrm = window.parent.Xrm;
    
                //get the current object id
                var oId = Xrm.Page.data.entity.getId();
    
                //get the object type
                var oType = Xrm.Page.context.getQueryStringParameters().etc;
    
                //set Relationship Name
                var relName = "lead_owning_user";
    
                //building a url
                var sUrl = "/userdefined/areas.aspx?oId=" + oId + "&oType=" + oType + "&pagemode=iframe&security=852023&tabSet=" + relName;
    
               
                //get relative path with orgname as required
                var relativeUrl = Xrm.Page.context.prependOrgName(sUrl);
                
                window.location = relativeUrl;
       
        </script>
    </head>
    <body>
    </body>
    </html>
  2. The only thing you need to change is the relationship name field. To do that open the entity relationships and get the schema name of the relationship. The following screen shot is displaying the relationship between user and lead entity. The user can be the owner of multiple leads.

    image
  3. Update the JavaScript in the HTML web resource. Save and publish the web resource.
  4. Open the entity form and click on navigation button. Then select the “navigation link” as shown in the following screen short.

    image
  5. The system will display the “Navigation Link Properties” dialog as shown in above screen shot. Enter the name for the navigation link. Choose an Icon and choose the web resource created in step 1 of the tutorial. Save the changes and publish the form.
  6. Open the form. The result will look like the following screen.

    image
Happy 2013 everyone.

Sunday, December 30, 2012

Displaying associated views for the relationships missing in relationship explorer.


In CRM2011 we have relationship explorer as shown in screen shot.
image
We can drag any available relationship from the relationship explorer to the form navigation. The navigation link will display the associated view for that relationship.

The problem is that the relationship explorer does not display all the relationships. For e.g.  system relationship between user and leads(to display all the leads owned by the user).
We can use the following URL to display any associated view.
http://servername/orgname/userdefined/areas.aspx?oId=<guid of the entity>&oType=<entity type code>&pagemode=iframe&security=852023&tabSet=<relationship shema name>

I got this URL from the existing associated views. There are few more parameters that can be passed to this URL like formid but they are optional.

Replace the highlighted values with the values from your deployment.
Here is an example of the URL with all the values. This URL will display the associated view of the leads owned by the user specified in the URL.
http://servername/orgname/userdefined/areas.aspx?oId=%7b734F5966-827C-E111-A07F-00155DDBE211%7d&oType=8&pagemode=iframe&security=852023&tabSet=lead_owning_user

I hope this helps.

Saturday, December 22, 2012

Strange behaviour when using security roles with the teams in CRM2011

I was trying to setup the security roles on teams instead of assigning security role to the individual users. The end result is that it does not work very well.

Here are the details of what happened.

I had a user with security role named “Manager”. Everything was working as expected. The user was able to create and update the entities defined in the security role. We decided to the create a team named “Manager” and assign the  role to the team. I added the user to the team and remove the security role from the user. Here is what happened after that

I was able to open , create and update the entities as defined in the security roles until we created a new for form for an existing entity.

When I tried to  open the newly created form for the entity, I received the following error message.

image

I had a look in the event viewer. It was showing the following warning message.

Exception message: SecLib::AccessCheckEx failed. Returned hr = -2147187962, ObjectID: 3be48aca-0f39-e211-bce1-005056b8253f, OwnerId: 9cc2541a-9137-e211-bce1-005056b8253f,  OwnerIdType: 8 and CallingUser: 9cc2541a-9137-e211-bce1-005056b8253f. ObjectTypeCode: 2500, objectBusinessUnitId: bf221f51-8537-e211-bce1-005056b8253f, AccessRights: WriteAccess

The object type code 2500 represents the entity “User Entity UI Settings”. I checked the permissions on the entity. The user had the required permissions on the entity. The most annoying part was that I was able to open the existing form without a problem.

So I decided to look a bit deeper into the problem and here are my findings.

1. I created a new user and add the user to the team without assigning any role to the user.

I received an error message “Access Is Denied” every time I tried to open any entity form.

2. I added the same security role to the user as security role assigned to the team.

I tried to open account and contact entity form and I was able to open them without an error.

3. I removed the security role from the user again

I was able to open the entity forms I tried in step 2 but, I was unable to open the form for any other entity or different  form for the same entity.

Conclusion:

You have to have a security role assigned to the user to open any entity form minimum for the first time.