• Chris K
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm implementing a custom Minimized LWC component for my snap-in chat, but my page loads with the standard UI. In order to display my custom UI override, I have initialize it with a button click.

How can I get my override to load on the page without the button click.  Is there a configuration step I'm missing in my implementation?
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.
 
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;
        }       
    }
}