Answered by:
CRM 2011 - UR16 - OnPremise - Entity Form: Owner field is shown when all field is disabled (locked).

Question
-
Hello everyone,
I'm having a weird problem in custom entity form. This is current situation:
+I have a custom entity form with 4 fields (shown by default and editable) in it along with system Owner field (hide by default and read only). It works fine.
+Now I disable all fields in entity form. When I open the form The Owner field is shown up and editable (!?) (in both CREATE and UPDATE mode)
The problem occurred regardless I disable all fields by Field settings (read-only option = true) or by jScript in OnLoad event.
The environment as in Title.
--> Do you know if this is CRM default behavior or it's a bug? Any comment is appreciate!
PS: The interesting case is: if I delay the disable jScript using setTimeout("disable function", 1000). Then the system Owner field is NOT shown...
Thursday, May 15, 2014 4:23 AM
Answers
-
Did you try to set focus on one of the visible fields of the form (on load event using javascript)?
- Proposed as answer by Payman BiukaghazadehEditor Thursday, May 15, 2014 7:33 AM
- Marked as answer by HIMBAPModerator Thursday, May 15, 2014 7:55 AM
Thursday, May 15, 2014 6:42 AMModerator
All replies
-
Hi,
I think I encountered a similar case, in which all the fields are disabled and the owner field is hidden and disabled. Upon the load of the form the owner field became enabled and visible. It seems that on the load of the form the scripts look for a field to focus and when they did not find anything they focus on the owner field. Seems like a bug. The workaround that I used is to set disabled and hide by script on the load of the form. Give this a try to see it helps you.
Thursday, May 15, 2014 6:24 AMModerator -
Hi Payman,
Thanks for your help. As said, I already try jScript but get the same result... It only works if I delay the script (1s in this case).
I guess it can't be help. This is really weird.
Thursday, May 15, 2014 6:35 AM -
Did you try to set focus on one of the visible fields of the form (on load event using javascript)?
- Proposed as answer by Payman BiukaghazadehEditor Thursday, May 15, 2014 7:33 AM
- Marked as answer by HIMBAPModerator Thursday, May 15, 2014 7:55 AM
Thursday, May 15, 2014 6:42 AMModerator -
Wow, your suggestion works! So your theory about "the scripts look for a field to focus and when they did not find anything they focus on the owner field" is correct.
I really want a non-code solution :D.
Thanks for your help!
Thursday, May 15, 2014 6:57 AM -
So, you have to wait MS fix this (for a non-code) ;)Thursday, May 15, 2014 7:33 AMModerator