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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portals: entity form only displaying in read only

(0) ShareShare
ReportReport
Posted on by 32

I have created an entity form for a serviceappointment that should allow users to update and save the information in the fields.

While the form for the correct record displays (using the id parameter for the source record), all of the fields are showing as read-only and the 'Submit' button is not showing. There are a mix of dropdowns and text fields, but none are changeable.

(to be really specific, if you examine the HTML the input control has `disabled="disabled"` set in its attributes, though I would expect this is being controlled by the entityform. If you delete the attribute in the developer console you're able to see the options in the dropdowns)

Some things:

  • The entityform type is set to 'Edit'.
  • Enable entity permissions is set and the relevant roles have been given Read and Write permissions.
  • The referenced native form works as expected on Dynamics CRM and none of the fields are set as read-only here.

I have created writeable entityforms for other entities before so I know what I'm doing, but am a bit stumped as to why my form is not allowing users to change the information in this case.

*This post is locked for comments

I have the same question (0)
  • oliver.rodrigues Profile Picture
    4,052 on at

    do you have any other Entity Form for the same entity that is read-only?

    if yes.. did you make sure your "content (non-root)" Web Page is pointing to the correct Entity Form?

  • _jmk_ Profile Picture
    32 on at

    Yes quite certain. I also tried it with a very simple version of the form (one field) but same results. 

    I suspect that that particular entity (Service Activity) is treated this way for some reason,though can find it documented (though that's not surprising).

    If someone has the time or inclination could they test on their own system?

  • Charles Abi Khirs Profile Picture
    3,569 on at

    Hello,

    Check if you are associating the correct entity permission to the right web role

  • Verified answer
    Nicholas Hayduk Profile Picture
    2,863 on at

    I did a bit of digging and I think I've figured out what's going on.

    In the code that renders an entity form (EntityForm.cs, github.com/.../EntityForm.cs), on line 579, it checks the status of the record.  Even if you've got everything setup correctly, the code requires that the statecode of the record is '0' to allow editing, otherwise it reverts to read-only mode.  In the case of a service appointment, generally they get set to "Scheduled", which means a statecode of 3.  In my testing, once I set the service appointment back to "Open", which is the statecode of 0, my form became editable.

    This is a poor assumption in the code - as we can see in this case, a statecode of 0 shouldn't necessarily be required to make it editable (although in most other cases, 0 means active, and 1 mean inactive).

    The only advice I can offer is to make the service appointments "Open", and also to submit a bug ticket to Microsoft - as far as I'm concerned this is a bug.

    Hope that helps.

    Nick

  • oliver.rodrigues Profile Picture
    4,052 on at

    great investigation Nicholas.. I would say perhaps nobody reported this bug to MS yet.. perhaps opening a ticket would be a good option

    or raising an issue in GIT.. not sure MS is monitoring the community project though

  • _jmk_ Profile Picture
    32 on at

    Can confirm that that is correct, after I changed status from 'scheduled' to 'open' on a service activty record the form on the portal became writable with all of my other settings staying intact.

    Here is the reference for the ServiceAppointment entity, which fails to describe the 'scheduled' (StateCode 3) status when saying "Completed and canceled service activities are read-only and can't be edited". https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/entities/serviceappointment#BKMK_StateCode

    Good find! (so much for all of the time that I had sunk into creating a new entity to work with the form). To use it in this way will create problems for us as we are using the Status Reason values in a logical way so I will open a ticket with MS.

  • _jmk_ Profile Picture
    32 on at

    MS don't monitor the community project as it is for custom deployments of Portal code, but I have created the issue here github.com/.../117 - though there may be a problem with simply saying 'make statecode of 3 editable' in all cases, as described there.

  • astanton44 Profile Picture
    2,265 on at

    Is the Entity setting "Read Only for Mobile" checked? This trips up everyone. Mobile tends to be more than mobile in the new UI.

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

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
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans