Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
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!

  • chauhanhardik Profile Picture
    37 on at
    Re: Setting Entity Field Read-Only on Portal page form

    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

  • bik@inturi Profile Picture
    16 on at
    Re: Setting Entity Field Read-Only on Portal page form

    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
  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Setting Entity Field Read-Only on Portal page form

    @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

     

  • Sumaira Profile Picture
    642 on at
    Re: Setting Entity Field Read-Only on Portal page form

    @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

  • Summer Garg Profile Picture
    48 on at
    Re: Setting Entity Field Read-Only on Portal page form

    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 !!!

  • Community Power Platform Member Profile Picture
    on at
    Re: Setting Entity Field Read-Only on Portal page form

    Hi Oliver,

     

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

     

  • Verified answer
    oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Setting Entity Field Read-Only on Portal page form

    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.

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35