• Rushikesh Pawar 7
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
We would like to see which records have an attachment attached from the list view.  To do this, we created a checkbox field HasAttachment, default unchecked, and the following trigger.  If the Expense custom object record has an attachment, then the HasAttachment field should update to TRUE.  We tested this trigger through 'Upload File' under the Notes and Attachments related list, however, the HasAttachment field remains unchecked.
 
trigger AttachmentonExpense on Attachment (after insert) 
{
Set setParentId = new Set();
List Expenselst = new List();

for(Attachment att: Trigger.new)
{
setParentId.add(att.ParentId);
}

Expenselst = [select Id , HasAttachment__c from Expense__c where Id IN :setParentId];

For(Expense__c e : Expenselst)
{
e.HasAttachment__c = True;
}

update Expenselst;
}

 
I'm using MS Windows 8.1 with Google Chrome Version 35.0.1916.114 m
I have a free Salesforce trial version

From the "My Name" menu I chose "Developer Console".
I get a new window Force.com Developer Console with the "Loading workspace ..." progress bar.
The progress bar gets hung at about 50%.

Any advice?

Odeddevelopers console will not load