Posts: 91
Threads: 32
Joined: May 2014
Reputation:
0
Hi,
i have created a custom module with field link (uitype =10) to organisations
however, in the CP, i see all records although they are not related to the logged contact
any ideas to debug?
rgds
Posts: 3,564
Threads: 36
Joined: Apr 2014
Reputation:
49
I created a ticket and did some testing:
<!-- m --><a class="postlink" href="http://corebos.org/development/view.php?id=280">http://corebos.org/development/view.php?id=280</a><!-- m -->
try that and let me know how it goes.
Joe
TSolucio
Posts: 91
Threads: 32
Joined: May 2014
Reputation:
0
Hi,
it's a custom module - not the existing one which works
module Points :
id
Name
accountid --> uitype 10 related to Organisations
when i enable the Module Points in CP , i see all records but it should be filtered to only accountid
i'll try to debug it
Posts: 3,564
Threads: 36
Joined: Apr 2014
Reputation:
49
I think it should work the same. Please try to get the SQL to see if it is constructing it correctly.
Joe
TSolucio
Posts: 91
Threads: 32
Joined: May 2014
Reputation:
0
Found it
in VTActiveResource.php
function defaultScope :
add the condition in the switch
case 'Points': //MSL
$condition = array('condition'=>"accountid='".Yii::app()->user->accountId."'");
break;
it does not construct the condition automatically using the field definition (ex : if uipte =10 and reltabid = 6) ==> $fieldname ==> ...
Posts: 3,564
Threads: 36
Joined: Apr 2014
Reputation:
49
I was tempted to tell you to add that but since you were capturing accounts I thought the switch would be applying the "Accounts" entry.
Glad you got it working. I will see if we can make this part of the application more generic
Joe
TSolucio