<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Alan,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">How are you doing well.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The intention about this behaviour change was:</div><div class="gmail_default"><ul><li><font face="arial, helvetica, sans-serif">Picklist value assignment to role was supposed to control the transition into the state.</font></li><ul><li>Allow user to view actual value assigned to field (Detail)</li><li><font face="arial, helvetica, sans-serif">Deny user from changing to value he/she not assigned to (Edit).</font></li></ul></ul><div><font face="arial, helvetica, sans-serif">Why?</font></div><div><ul><li><font face="arial, helvetica, sans-serif">V6 was showing 'Not Accessible' in Detail of record if picklist value was not assigned to user.</font></li><ul><li><font face="arial, helvetica, sans-serif">This was very confusing and troubling user to carry out filtering or acting on record.</font></li></ul></ul><div><font face="arial, helvetica, sans-serif">So was the changes you pointed. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Regards,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Prasad</div></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">--</div><div dir="ltr"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><a href="http://www.facebook.com/vtiger" style="color:rgb(0,0,204)" target="_blank">FB</a> I </span><a href="http://twitter.com/vtigercrm" style="color:rgb(0,0,204)" target="_blank">Twit</a> I <a href="https://www.linkedin.com/company/1270573?trk=tyah" style="color:rgb(0,0,204)" target="_blank">LIn</a> I <a href="https://blogs.vtiger.com" style="color:rgb(0,0,204)" target="_blank">Blog</a> I <a href="https://www.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Website</a></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Oct 17, 2018 at 1:36 PM, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bump.<div><div class="h5"><br>
<br>
On 09/10/2018 09:31, Alan Lord wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On a module where there are quite a few role based picklists and the system has a large number of roles/users, and your user is high up the Role hierarchy the page load time for Detail View is stupidly slow.<br>
<br>
Compare these two queries from the logs:<br>
<br>
V7.1<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Prepared sql query being executed : SELECT distinct sales_stage FROM vtiger_sales_stage inner join vtiger_role2picklist on vtiger_sales_stage.picklist_va<wbr>lueid=vtiger_role2picklist.pic<wbr>klistvalueid and roleid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?<wbr>,?,?,?,?,?,?,?,?) order by sortorderid<br>
Tue Oct  9 07:16:06 2018,350 [7280] DEBUG VT - Prepared sql query parameters : [H2,H202,H3,H38,H37,H112,H113,<wbr>H172,H114,H115,H200,H116,H117,<wbr>H173,H118,H119,H199,H120,H121,<wbr>H168,H204,H122,H123,H124,H125,<wbr>H183,H126,H127,H197,H129,H130,<wbr>H131,H132,H133,H134,H188,H135,<wbr>H145,H189,H136,H146,H193,H137,<wbr>H147,H190,H138,H148,H191,H139,<wbr>H149,H140,H150,H141,H151,H201,<wbr>H142,H152,H143,H153,H186,H144,<wbr>H203,H154,H187,H155,H156,H174,<wbr>H157,H161,H158,H162,H159,H163,<wbr>H16,H160,H164,H169,H170,H20,H1<wbr>7,H175,H179,H176,H180,H198,H17<wbr>7,H181,H178,H182,H21,H192,H184<wbr>,H185,H22,H23,H171,H26,H52] <br>
</blockquote>
<br>
V6.3<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ELECT sales_stage<br>
                  FROM vtiger_sales_stage<br>
                      INNER JOIN vtiger_role2picklist on vtiger_role2picklist.picklistv<wbr>alueid = vtiger_sales_stage.picklist_va<wbr>lueid<br>
                  WHERE roleid=? and picklistid in (select picklistid from vtiger_picklist) order by sortorderid<br>
Tue Oct  9 07:29:27 2018,070 [6621] DEBUG VT - Prepared sql query parameters : [H2]<br>
</blockquote>
<br>
<br>
The difference appears to be due changes in the vtiger DetailRecordStructure model...<br>
<br>
In v7 a role based picklist is generated by calling the getAssignedPicklistValues() function in the modules/Picklist/PicklistUtils<wbr>.php file.<br>
<br>
In v6, a role based picklist calls the Vtiger_Util_Helper::getRoleBas<wbr>edPicklistValues() static method.<br>
<br>
Note. This is not the same when you open the page in Edit view in v7, when the more simple getRoleBasedPicklistValues() static method is used again.<br>
<br>
Before I simply go and fix the Detail (and Summary) record structure models, I would like to know why the change was made and what the implications are of using the static method vs the getAssignedPicklistValues() function? I am not quite sure I understand why it is necessary to check all subordinate roles and why only in Detail/Summary and not in Edit?<br>
<br>
<br>
Cheers<br>
<br>
Al<br>
<br>
______________________________<wbr>_________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
<br>
</blockquote>
<br>
<br></div></div>
______________________________<wbr>_________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br></div>