You need to sign in to do that
Don't have an account?
Kevin Caballes 10
Variable does not exist Error for opportunity field
I am attempting to save the following but keep getting the error:
Error: Compile Error: Variable does not exist: Send_Attachment_Notification_Email__c at line 20 column 17
The API name for the field on the opportuity object is Send_Attachment_Notification_Email__c so I am not sure what I could be doing wrong.
Error: Compile Error: Variable does not exist: Send_Attachment_Notification_Email__c at line 20 column 17
The API name for the field on the opportuity object is Send_Attachment_Notification_Email__c so I am not sure what I could be doing wrong.
trigger attachmentTrigger on Attachment (before insert) { // 1. Get List of Object Ids you wish to notify on Set<Id> objectIds = new Set<Id>(); // 2. Loop through list of attachments, and if attachment is associated to object you want to notify on, add Parent Id to objectIds set for(Attachment a:trigger.new){ String keyPrefix = string.valueOf(a.ParentId).substring(0, 3); if(keyPrefix == '500'){ objectIds.add(a.ParentId); } } // 3. Get your objects you want to notify on, and set the Send Attachment Notification Email field to True // This will to fire the workflow rule to send the email if(objectIds.size() > 0){ List<CASE> yourObjectList = [SELECT Id FROM CASE WHERE Id IN :objectIds]; for(CASE obj:yourObjectList){ obj.Send_Attachment_Notification_Email__c = TRUE; } if(yourObjectList.size() > 0){ update yourObjectList; } } }
There is no field 'Send_Attachment_Notification_Email__c' existing on case object.
Can you recheck same?
Thanks,
Vinay Kumar
All Answers
There is no field 'Send_Attachment_Notification_Email__c' existing on case object.
Can you recheck same?
Thanks,
Vinay Kumar
are you sure that in Case object do you have a custom field named Send_Attachment_Notification_Email__c? Be sure of that by navigate throught the object manager.
Maybe a wrong character is your problem.
Be sure that this field is on Case object and not on another object.
Claudio