Microsoft Developer Network > Forums Home > Dynamics Forums > CRM > Can I make Mobile Express forms read-only?

Answered Can I make Mobile Express forms read-only?

  • Tuesday, January 31, 2012 10:53 AM
     
     

    Hi there,

    I have a dilemma. My users want to use Mobile Express. However, some of my forms have important jscript for when editing records.

    I have no issue in allow using users to view records with Mobile Express. But I would like to prevent users from editing records when using Mobile Express.

    Is this possible?

    Regards,
    P. 


    MCC, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

Answers

  • Tuesday, January 31, 2012 2:11 PM
     
     Answered Has Code

    Hi pmdci,

    Had a quick look and this is the new changes: on the same folder, open entityhome.css.aspx and change:

     

    .newRecordButton
    {
    padding : 4px;
    display: none;
    }
    

    on the entityform.css.aspx:
    input.editButton
    {
    display: none;
    <% if (CrmStyles.IsRightToLeft) { %> float: right; <% } else { %> float: left; <% } %> width: 108px; } input.deleteButton {
    display: none;
    <% if (CrmStyles.IsRightToLeft) { %> float: left; <% } else { %> float: right; <% } %> width: 108px; }

     

    Reset IIS


    And this should hide the edit new and delete buttons. :)

     


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com



All Replies

  • Tuesday, January 31, 2012 11:10 AM
     
     

    Hi pmdci,

    I've actually blogged about this recently.

    Have a look here, I explain how this can be done, hope it helps:

    http://quantusdynamics.blogspot.com/2012/01/dynamics-crm-40-mobile-express-read.html

     

    Regards

    Nuno


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com
  • Tuesday, January 31, 2012 11:13 AM
     
     

    Fantastic! Thanks for the answer!

    Even tough this is a CRM 4 solution I am sure I can adapt it to CRM 2011.

    In fairness Microsoft should add the option to hide certain fields (delete, edit, new, etc) by default in Mobile Express forms.

     


    MCC, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
  • Tuesday, January 31, 2012 11:36 AM
     
     

    Hi there,

    I tried adapting your solution for Dynamics CRM 2011 but so far I had no luck. Not even after IISRESET... :(

    Have you tried doing this for Dynamics CRM 2011? Any ideas?

    P.

     


    MCC, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
  • Tuesday, January 31, 2012 11:42 AM
     
     
    No Haven't tried yet, but will be doing this in Feb will let you know :)
    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com
  • Tuesday, January 31, 2012 12:49 PM
     
     

    I managed this in CRM4 by using a plugin to disable Create/Update of entities or specific fields - you can just remove fields from the target entity attribute list. In CRM4 you could use code like "System.Web.HttpContext.Current.Request.Url.ToString()" to get the current URL - if the URL has /m/ at the beginning then the user is accessing CRM via the mobile client, so you can disallow changes on mobile but allow on full client. I haven't tried this on CRM2011 but it should work as long as your plugin is not running in the sandbox (so not compatible with CRM online). So whilst it looked like a user could change any field, any data for restricted fields was just ignored.

     

  • Tuesday, January 31, 2012 2:11 PM
     
     Answered Has Code

    Hi pmdci,

    Had a quick look and this is the new changes: on the same folder, open entityhome.css.aspx and change:

     

    .newRecordButton
    {
    padding : 4px;
    display: none;
    }
    

    on the entityform.css.aspx:
    input.editButton
    {
    display: none;
    <% if (CrmStyles.IsRightToLeft) { %> float: right; <% } else { %> float: left; <% } %> width: 108px; } input.deleteButton {
    display: none;
    <% if (CrmStyles.IsRightToLeft) { %> float: left; <% } else { %> float: right; <% } %> width: 108px; }

     

    Reset IIS


    And this should hide the edit new and delete buttons. :)

     


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com



  • Wednesday, February 01, 2012 11:25 AM
     
     

    Brilliant! Worked like a charm.

    Thanks for the update!

    Regards,
    P. 


    MCC, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".