web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set Lookup field to Read-Only

(0) ShareShare
ReportReport
Posted on by 70

Hi,

I don't manage to set my Lookup entity field to Read-Only mode on my form... Even if I clicked on "Field is read-only", then "Save" and then "Publish". How can I do that please ?

Regards,

Camille

2018_2D00_05_2D00_30-14_5F00_07_5F00_58_2D00_Form_5F00_-Product.png

*This post is locked for comments

I have the same question (0)
  • Faisal Hussona Profile Picture
    5 on at

    $('#can_reportedbycontact').attr("readonly","readonly");//lookup field
    $('#can_reportedbycontact').parent().find('.input-group-btn').hide();

  • Camille Pantin Profile Picture
    70 on at

    Hi,

    Indeed, this error is due to custom code.

    I think this is this code that block me from making this field read only.

    Thank you all for your help

    Regards

    Camille

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    The  error is coming from different function called Disableddivision.  Please check in the function some control is getting  null. So you need to do null check and then getValue from control.

  • Camille Pantin Profile Picture
    70 on at

    Hi Goutam,

    I tried this javascript but I get this error, even after removing it, after clearing cache and even after removing the fiel from my form :2018_2D00_05_2D00_30-16_5F00_32_5F00_13_2D00_Product_5F00_-ATLANS-Post_2D00_Processing-Software.png
    Could you help me removing it please ?

    Thank you & regards,

    Camille

  • Verified answer
    Justinjose Profile Picture
    2,707 on at

    Hi Camille,

    It should work. Can you give a try publishing all solutions and try in Private or Incognito  mode in the browser. Just to make sure caching is not causing the issue. Also try on a different lookup field for a test.

    Thanks

    Justin Jose

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Camille,

    Silly question, but might be worth asking, did you refresh your main page browser AFTER you published the changes?

    Publishing any changes on any entity does not show up on an entity page until it is either refreshed or reopened.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Camillie,

    Ideally its should work , not sure I am assuming some other customization making the field unlock.  Try to create one business rules or may be use javascript in the onload method see how its behave.

           function FieldDisable() {
                
                    Xrm.Page.getControl("lookupFieldName").setDisabled(true);
                    Xrm.Page.getAttribute("LookupFieldName").setSubmitMode("always");
               
           }


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Shidin Haridas Profile Picture

Shidin Haridas 2

#2
Abdullah13 Profile Picture

Abdullah13 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans