<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/1641/can-i-use-a-dependency-to-set-entire-record-to-read-only</link><description>I know how to use a dependency to set one or more fields to ReadOnly but is there a simple way to set EVERY field in a record to read only without having to do it for each field? I would like to avoid using the controllers to get it done for each view</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/thread/6567?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 20:37:39 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:5707be36-bbf9-4e14-a433-5ea360ad9ac2</guid><dc:creator>Shad Mickelberry</dc:creator><description>&lt;p&gt;Awesome. I&amp;#39;ll have to keep this in mind myself. It comes up from time to time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/thread/6566?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 19:34:07 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:9fb76afa-d85d-4ce9-96db-c66efff31c9c</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;And it worked like a charm! Thank you again &lt;a href="https://sugarclub.sugarcrm.com/members/shadresolute"&gt;Shad Mickelberry&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/thread/6565?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 17:47:38 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:36c7390c-5804-49ae-aeb4-055ce8692266</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;I like that solution,&amp;nbsp;&lt;a href="https://sugarclub.sugarcrm.com/members/esimonetti"&gt;Enrico Simonetti&lt;/a&gt;&amp;#39;s&amp;nbsp;&amp;nbsp;example for:&amp;nbsp;&lt;span style="border:0px;font-weight:bold;"&gt;&lt;strong&gt;Conditional record locking through ACL&amp;rsquo;s customisation&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;sounds exactly&amp;nbsp;like what I need to do, I had seen that article some time ago and forgotten about that. Thank you Shad Mickelberry&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/thread/6564?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 17:09:22 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:7db15ece-bd5a-49c1-8255-e4afa4087541</guid><dc:creator>Shad Mickelberry</dc:creator><description>&lt;p&gt;I haven&amp;#39;t done any customizations with this before but perhaps a custom ACL rule would be best:&lt;/p&gt;&lt;p&gt;&lt;a href="https://enricosimonetti.com/powerful-customisations-with-sugars-acl/" rel="nofollow" target="_blank"&gt;https://enricosimonetti.com/powerful-customisations-with-sugars-acl/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use a dependency to set entire record to read only?</title><link>https://sugarclub.sugarcrm.com/thread/6563?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 16:32:54 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:b53949a1-c16e-4ff1-84e8-a814ae8c5b7b</guid><dc:creator>Andr&amp;#233; Lopes</dc:creator><description>&lt;p&gt;We have done it&amp;nbsp;recently.&lt;/p&gt;&lt;p&gt;Basically you need to create a custom rowaction field which automatically set itself as disabled given&amp;nbsp;a trigger.&lt;/p&gt;&lt;p&gt;Find examples:&lt;/p&gt;&lt;p&gt;custom/clients/base/fields/unlink-action-deactivable/unlink-action-deactivable.js&lt;/p&gt;&lt;p&gt;({&lt;br /&gt; extendsFrom: &amp;#39;UnlinkActionField&amp;#39;,&lt;/p&gt;&lt;p&gt;initialize: function(options) {&lt;br /&gt; this._super(&amp;quot;initialize&amp;quot;, [options]);&lt;br /&gt; },&lt;/p&gt;&lt;p&gt;bindDataChange: function() {&lt;br /&gt; _.each(this.def.deactivable.triggerFields, function(field) {&lt;br /&gt; this.context.parent.get(&amp;#39;model&amp;#39;).on(&amp;#39;change:&amp;#39; + field, this.deactivate, this);&lt;br /&gt; }, this);&lt;br /&gt; },&lt;/p&gt;&lt;p&gt;deactivate: function() {&lt;br /&gt; if(this.context != null) {&lt;br /&gt; var context = new SUGAR.expressions.SidecarExpressionContext(this.parent, this.context.parent.get(&amp;#39;model&amp;#39;), false);&lt;br /&gt; var value = SUGAR.expressions.ExpressionParser.prototype.evaluate(this.def.deactivable.trigger, context).evaluate();&lt;/p&gt;&lt;p&gt;if(value == &amp;#39;true&amp;#39;) {&lt;br /&gt; if(!this.getFieldElement().hasClass(&amp;#39;disabled&amp;#39;)) this.getFieldElement().addClass(&amp;#39;disabled&amp;#39;);&lt;br /&gt; } else {&lt;br /&gt; if(this.getFieldElement().hasClass(&amp;#39;disabled&amp;#39;)) this.getFieldElement().removeClass(&amp;#39;disabled&amp;#39;);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;})&lt;/p&gt;&lt;p&gt;subpanel-list for a given module&lt;/p&gt;&lt;p&gt;&amp;#39;rowactions&amp;#39; =&amp;gt; array(&lt;br /&gt; &amp;#39;actions&amp;#39; =&amp;gt; array(&lt;br /&gt; array(&lt;br /&gt; &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;rowaction&amp;#39;,&lt;br /&gt; &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;btn&amp;#39;,&lt;br /&gt; &amp;#39;tooltip&amp;#39; =&amp;gt; &amp;#39;LBL_PREVIEW&amp;#39;,&lt;br /&gt; &amp;#39;event&amp;#39; =&amp;gt; &amp;#39;list:preview:fire&amp;#39;,&lt;br /&gt; &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;fa-eye&amp;#39;,&lt;br /&gt; &amp;#39;acl_action&amp;#39; =&amp;gt; &amp;#39;view&amp;#39;,&lt;br /&gt; ),&lt;br /&gt; array(&lt;br /&gt; &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;unlink-action-deactivable&amp;#39;,&lt;br /&gt; &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;fa-chain-broken&amp;#39;,&lt;br /&gt; &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_UNLINK_BUTTON&amp;#39;,&lt;br /&gt; &amp;#39;deactivable&amp;#39; =&amp;gt; array(&lt;br /&gt; &amp;#39;triggerFields&amp;#39; =&amp;gt; array(&amp;#39;status&amp;#39;),&lt;br /&gt; &amp;#39;trigger&amp;#39; =&amp;gt; &amp;#39;or(isInList($status, createList(&amp;quot;Closed&amp;quot;, &amp;quot;Cancelado&amp;quot;, &amp;quot;Pedido nao Postado&amp;quot;)), not(isUserInList(createList(&amp;quot;SIMM_GER&amp;quot;, &amp;quot;SIMM_SUP&amp;quot;))))&amp;#39;,&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; ),&lt;br /&gt; ),&lt;/p&gt;&lt;p&gt;This solution, with minor adjustments, works oover any&amp;nbsp;button (Edit, Save, Unlink, Add etc).&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>