当我执行下面的代码时,我得到了无效的绑定表达式。如果我犯了任何错误,可以解释一下。
公共无效 ShareAPRwithAdvisor(列出 aprs){
List<APR__Share> APRShareList = new List<APR__Share>();
List<APR__c> apraccList=new List<APR__c>([SELECT id,APR_AdvisorName__c FROM APR__c WHERE Id IN:aprs]);
List<Account> usrlist=new List<Account>([SELECT id,Advisor_User__pc FROM Account WHERE Id IN:apraccList]);
System.debug('APR********************'+aprs);
// System.debug('APR********************'+aprs.APR_AdvisorName__c);
for(APR__c apr : aprs){
if(apr.APR_AdvisorName__c != null){
APR__Share aprshare = new APR__Share();
aprshare.ParentID = apr.ID;
aprshare.UserorGroupID = usrlist.Advisor_User__pc;
aprshare.AccessLevel = 'Edit';
APRShareList.add(aprshare);
}
System.debug('APRShareList'+APRShareList);
}