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 :
Power Platform Community / Forums / Power Pages / Setting Entity Field R...
Power Pages
Answered

Setting Entity Field Read-Only on Portal page form

(0) ShareShare
ReportReport
Posted on by

Hello Community,

 

I have created a custom portal, linked to a Dynamics 365 instance. On the portal page, I have a form for submission which would then create a Lead record in Dynamics. Does anyone know if there is a way without applying custom codes (if possible) to make a field read-only on the portal page form? It appears even if the field is read-only on the entity form in Dynamics, it's still editable on the portal page.

 

Any pointers would be appreciated! Thank you!

Categories:
I have the same question (0)
  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, if you have it set as read-only in CRM form this should reflect in the Portals, have you make sure to publish/clear cache/clear config?

     

    if you need in a dynamic way, you can set via JS: 

    $("#firstname").attr("readonly", true);

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Community Power Platform Member Profile Picture
    on at

    Hi Oliver,

     

    Thank you very much for your reply! I have successfully resolved this now after clearing the cache.

     

  • Summer Garg Profile Picture
    48 on at

    Hi,

     

    Check this one:

    https://crmhub.blogspot.com/2017/11/how-to-use-java-script-in-adx-studio.html

     

    For more tutorial list , check this one :

    https://crmhub.blogspot.com/p/d365-portal-adx-studio-portal.html

     

    Keep Learning, keep Sharing , Keep Growing !!!

  • Sumaira Profile Picture
    642 on at

    @OliverRodrigues @Anonymous @CRM_HUB I'm looking for same solution

    Could you please help me on where i need to add the $("#firstname").attr("readonly", true);

    So that my field becomes read only

    Kindly Advise

    Best Regards,

    Sumaira Noor

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    @Sumaira the Portal entities have a Custom JavaScript field and that's where you place your JS code

    usually you can add the JS in Entity List / Web Page (localized webpage, non-root) / Entity Form / Web Form Step

    there are a few more places you can add but those are the most common

    https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript

     

  • bik@inturi Profile Picture
    16 on at

    Hi Oliver

     

    The 

    $("#fieldname").attr("readonly", false/true) does not work on Drop down attribute.. its converted the control box to grey but the user can still click and see the values in the list and change etc.
     
    If I disable the control then the value in it is set to Blank on the save of the form.
     
    Thanks
    Bik
  • chauhanhardik Profile Picture
    37 on at

    Hi bik,

     

    there's a way to disable drop down attribute as well. Below line of code will disable all drop down attributes on web page.

     

    $('.control').find("select").prop("disabled","disabled");

     

    Regards,

    Hardik Chauhan

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

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 74 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard