You need to sign in to do that
Don't have an account?

Opportunity Flag Update
Hi All,
I created a field EAQ_Email_Flag__c as flag which default value is false.But after sending the mail i want to update it
true.My approach is like that
List <Opportunity> opptyList = new List<Opportunity>();
for(Opportunity oppnew:Trigger.new){
opptyList.add(opptyList);
}
But after Sending mail when I write
opptyList.EAQ_Email_Flag__c=true;
update opptyList;
Error it shows:-Variable does not exist: EmaiStatusChange at line 127 column 66
Can anybody help me ou in solving this problem.I am sending single email to Owner.
With Regards
Prabhash Mishra
Its a bit tricky to tell without the full code I'm afraid - as the error refers to line 127 it sounds like you have quite a bit of code there too.
Variable doesn't exist is sometimes as simple as a typo - have you misspelled the name on line 127.
I have to send Single mail to Opportunity Owner and Update Flage to true after sending mail which default is false.
Code is something like that:FOR READIBILITY I OMITT UNNECESSARY CODE ;
trigger ExposureAssessmentQuestionnaireAlert on Opportunity (before update) {
String MailSubject='Reminder For Exposure Assessment Questionnaire';
Set<String> UpdatedState=new Set<String>();
Set<String> UpdatedStage=new Set<String>();
Set<Id> Recordtypeid=new Set<Id>();
Set<String> Opptype=new Set<String>();
List<Decimal> UpdatedECV=new List<Decimal>();
Set<String> PriorityIndustry=new Set<String>();
Set<Id> OwnerIdSet=new Set<Id>();
Set<Boolean> emalSent=new Set<Boolean>();
List <Opportunity> opptyList = new List<Opportunity>();
for(Opportunity oppnew:Trigger.new){
UpdatedState.add(oppnew.INTL_Status__c);
UpdatedStage.add(oppnew.StageName);
Recordtypeid.add(oppnew.RecordTypeId);
Opptype.add(oppnew.OPPTY_TYPE__c);
UpdatedECV.add(oppnew.EST_CHARGE_VOL__c);
PriorityIndustry.add(oppnew.IND_MAP_TBL__c);
OwnerIdSet.add(oppnew.OwnerId);
emalSent.add(oppnew.EAQ_Email_Flag__c);
opptyList.add(oppnew);
}
List<RecordType> rt=[select id,name from RecordType where Id in:Recordtypeid AND SobjectType='opportunity'];
Set<String> RecordTypeName=new Set<String>();
for(RecordType rtypename:rt){
RecordTypeName.add((String)rtypename.name);
}
List<IND_MAP_TBL__c> IndustryNameId=[Select id,Name from IND_MAP_TBL__c where Id in:PriorityIndustry];
List<String> IndustryName=new List<String>();
//Set<Id> IndustryId=new Set<Id>();
for(IND_MAP_TBL__c imt:IndustryNameId){
IndustryName.add((String)imt.name);
//IndustryId.add((Id)imt.id);
}
List<User> OwnerEmail=[Select Email from user where Id in:OwnerIdSet];
String[] OwnermailId=new String[OwnerEmail.size()];
integer i=0;
for(User eId:OwnerEmail){
OwnermailId[i]=(String)eId.email;
i++;
}
if((UpdatedStage.contains('4. Formal Offer') || UpdatedStage.contains('5. Verbal Win')) || (!UpdatedState.contains('Rejected'))){
if(RecordTypeName.contains('MA B2B Opportunity') || RecordTypeName.contains('MA B2C Opportunity') || RecordTypeName.contains('MA Prospecting Opportunity')){
System.debug(industryNames.indexOf(IndustryName.get(0).trim().substring(IndustryName.get(0).trim().indexOf('-')+1,IndustryName.get(0).trim().length()))>-1);
System.debug(industryCode.indexOf(IndustryName.get(0).trim().substring(0,IndustryName.get(0).trim().indexOf('-')-1)));
if(Opptype.contains('Standard') && UpdatedECV.get(0)>1000000.00 && industryNames.indexOf(IndustryName.get(0).trim().substring(IndustryName.get(0).trim().indexOf('-')+1,IndustryName.get(0).trim().length()))>-1 && industryCode.indexOf(IndustryName.get(0).trim().substring(0,IndustryName.get(0).trim().indexOf('-')-1))>-1){
EAQReminderToMBD.sendmail(OwnermailId,MailSubject,Open45Body);
opptyList.EAQ_Email_Flag__c=true;
update opptyList;
}
}
}
else if(UpdatedStage.contains('6. Complete') && (!UpdatedState.contains('Rejected'))){
if(RecordTypeName.contains('MA B2B Opportunity') || RecordTypeName.contains('MA B2C Opportunity') || RecordTypeName.contains('MA Prospecting Opportunity')){
if(Opptype.contains('Standard') && UpdatedECV.get(0)>1000000.00 && industryNames.indexOf(IndustryName.get(0).trim().substring(IndustryName.get(0).trim().indexOf('-')+1,IndustryName.get(0).trim().length()))>-1 && industryCode.indexOf(IndustryName.get(0).trim().substring(0,IndustryName.get(0).trim().indexOf('-')-1))>-1){
EAQReminderToMBD.sendmail(OwnermailId,MailSubject,Signed6CompleteBody);
opptyList.EAQ_Email_Flag__c=true;
update opptyList;
}//inner if
}//middle if
}//outer if
}
With Regards
Prabhash Mishra
Is the line that the error occurs on part of that post? I can't find StatusChange anywhere in there.
Hi,
Field Name: EAQ_Email_Flag__c.boolean field it is.
With Regards
Prabhash Mishra
But the error you posted was:
Variable does not exist: EmaiStatusChange at line 127 column 66
Which doesn't match the line of code you have pointed to.