You need to sign in to do that
Don't have an account?
SFDCmack08180939826349907
I am trying to build a visualforce page that shows the Account names, their related territories, and user field isActive
I am stuck trying to get the Group query to get the territory name, could someone let me know what I am doing wrong here, I get this error message
'Initial term of field expression must be a concrete SObject: List<AccountShare>'
VF:
Apex:
'Initial term of field expression must be a concrete SObject: List<AccountShare>'
VF:
<apex:page controller="DisplayQueryList"> <apex:pageBlock title="My Content"> <apex:pageBlockTable value="{!Recs}" var="Record"> <apex:column > <apex:facet name="header">User</apex:facet> <apex:outputText value="{!Record.Id}"/> </apex:column> <apex:column > <apex:facet name="header">UserID or Group</apex:facet> <apex:outputText value="{!Record.UserOrGroupId}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
Apex:
public with sharing class TestDisplayQueryList{ public List<AccountShare> Recs {get; set;} public DisplayQueryList(){ Rec = [Select Id, UserOrGroupId from AccountShare where (RowCause ='Territory' OR RowCause = 'TerritoryManual' )And AccountId='001i0000009Rmz5' ]; Group grp =[select id from Group where id IN :Records.id ]; } }
public with sharing class TestDisplayQueryList{
public List<AccountShare> Recs {get; set;}
public TestDisplayQueryList(){
Recs = [Select Id, UserOrGroupId from AccountShare where (RowCause ='Territory' OR RowCause = 'TerritoryManual' )And AccountId='001i0000009Rmz5' ];
Group grp =[select id from Group where Id =: Recs[0].Id ];
}
}
Thank you :)
All Answers
public with sharing class TestDisplayQueryList{
public List<AccountShare> Recs {get; set;}
public TestDisplayQueryList(){
Recs = [Select Id, UserOrGroupId from AccountShare where (RowCause ='Territory' OR RowCause = 'TerritoryManual' )And AccountId='001i0000009Rmz5' ];
Group grp =[select id from Group where Id =: Recs[0].Id ];
}
}
Thank you :)