You need to sign in to do that
Don't have an account?
Srinivas223
the error message is Unexpected token 'opp.ownerid'.
I appreciate your help.
Thank you
Can anyone tell me what is wrong here
for(REVVY__MnContract__c contract: NewMap.values()) { if (oldMap.get(contract.Id).ContractStage__c == 'Signature|Completed' && contract.ContractStage__c == 'Booked|In Effect') { if(contract.REVVY__Opportunity__c != null){ system.debug('00000000' + contract.REVVY__Opportunity__r.owner ); mapContracts.put(contract.REVVY__Opportunity__c, contract); } } } // the method is to send an email when MnContract life cycle is activated. We do not activate bulk records at a time // so not considering bulk here acRels = new list<Aircraft_Relationship__c>(); user OpptyUser = new user(); if(!mapContracts.isEmpty()) { Opp = [select id, name,(select id,Date_Ordered__c, Aircraft__r.name, Opportunity__r.name,Aircraft_User__r.name from A_C_Relationships__r),ownerid from opportunity where id =: (mapContracts.keyset())[0]]; // system.debug('-----0000----' + ContractOpptyIDs); for(Aircraft_Relationship__c acRel: opp.A_C_Relationships__r){ acRels.add(acRel); } system.debug('the no of ac Rel associated to the opp ' + acRelsize.size()); } if(Opp != null){ OpptyUser = [select id, name, email from User where id = opp.ownerid] ; EmailTemplate emailTemplates = [select id,name,subject from EmailTemplate where name = 'Contract Stage Activate Notification' and isActive = true and TemplateType = 'visualforce' limit 1]; system.debug('00000000'+ emailTemplates );
the error message is Unexpected token 'opp.ownerid'.
I appreciate your help.
Thank you
OpptyUser = [select id, name, email from User where id = : opp.ownerid] ;
Thanks , let us know if it helps you
SOQL and SOSL statements in Apex can reference Apex code variables and expressions if they’re preceded by a colon (:).