Answered by:
Disable Evrything in a form- CRM 2011

Question
-
Hi,
How can I disable everything in CRM From. I am able to disable all fields. But I wnat to disable all sub grids, buttons in left side navigation pane, so that no related records can be added.
Thanks & Regards,
Soumya.
soumyaTuesday, October 4, 2011 9:42 AM
Answers
-
I think you are basically talking about disabling a record. Otherwise write permissions and such are determined by security roles. You could do this in code behind a ribbon button or something using a jscript web resource call.
Here is a syntax example for the setstaterequest (for disabling and enabling records):
http://mileyja.blogspot.com/2011/07/set-status-or-state-of-record-using.html
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Tuesday, October 4, 2011 10:53 AMModerator -
The fields are easy enough with jscript, but all the other items would be driven by the status of the record or by permissions. I don't know of another supported way to do what you are trying to do.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Tuesday, October 4, 2011 2:03 PMModerator -
Getelementbyid is not supported for use in CRM outside of independent webresources.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Monday, July 9, 2012 3:57 PMModerator
All replies
-
I think you are basically talking about disabling a record. Otherwise write permissions and such are determined by security roles. You could do this in code behind a ribbon button or something using a jscript web resource call.
Here is a syntax example for the setstaterequest (for disabling and enabling records):
http://mileyja.blogspot.com/2011/07/set-status-or-state-of-record-using.html
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Tuesday, October 4, 2011 10:53 AMModerator -
Based on a particular field value, I want all controls on the form to be disabled. Security roles is not an option. I will leave this particular field alone enabled , so when i change it back, the form controls will be enabled back.
When I say the form is disabled, I want everything except the particular field to be disabled. everything includes , all fields, subgrids, navigation items, so that user cannot add any related entity records. options in the file menu, etc.
soumyaTuesday, October 4, 2011 11:41 AM -
The fields are easy enough with jscript, but all the other items would be driven by the status of the record or by permissions. I don't know of another supported way to do what you are trying to do.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Tuesday, October 4, 2011 2:03 PMModerator -
Based on a particular field value, I want all controls on the form to be disabled. Security roles is not an option. I will leave this particular field alone enabled , so when i change it back, the form controls will be enabled back.
When I say the form is disabled, I want everything except the particular field to be disabled. everything includes , all fields, subgrids, navigation items, so that user cannot add any related entity records. options in the file menu, etc.
soumyaI dont know about disabling the subgrids and navigation items, but you can disabled the ribbons based on a field value using the EnableRules. You can also hide the navigation bar using jscript or Hide the Ribbon Bar using jscript.
Here is snippet to hide the navigation bar:
function hideNavigationBar() {
document.getElementById("crmNavBar").parentElement.style.display = "none";
document.getElementById("tdAreas").parentElement.parentElement.parentElement.parentElement.colSpan = 2;
}Here is the snippet to hide the Ribbon Bar:
function hideRibbon() {
window.top.document.getElementById("crmTopBar").style.display = "none";
window.top.document.getElementById("crmContentPanel").style.top = "0px";
}I hope this helps.
Regards,
Frank
- Edited by frankhernandez Tuesday, October 4, 2011 2:45 PM
Tuesday, October 4, 2011 2:44 PM -
Getelementbyid is not supported for use in CRM outside of independent webresources.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Jamie MileyModerator Monday, July 9, 2012 3:57 PM
Monday, July 9, 2012 3:57 PMModerator