• Gnani Matavalam
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi Experts,

I am not sure why this is not working, I found this code in the net and I thought this is working just fine. There is an error about list. Please help.
 
trigger triggerOnAttachment on Attachment (before insert) {
    List OppList = new List();
    Set OppIds = new Set();
    for(Attachment att : trigger.New){
         //Check if added attachment is related to Account or not
         if(att.ParentId.getSobjectType() == Oppportunity.SobjectType){
              OppIds.add(att.ParentId);
         }
    }
    accountList = [select id, hasAttachment__c from Opportunity where id in : OppIds];
    if(OppList!=null && OppList.size()>0){
        for(Opportunity Opp : OppList){
            Opp.hasAttachment__c = true;
        }
        update OppList;
    }
}

It is saying Unexpected Error on List. 
  • August 29, 2016
  • Like
  • 0
Hi Experts,

I am not sure why this is not working, I found this code in the net and I thought this is working just fine. There is an error about list. Please help.
 
trigger triggerOnAttachment on Attachment (before insert) {
    List OppList = new List();
    Set OppIds = new Set();
    for(Attachment att : trigger.New){
         //Check if added attachment is related to Account or not
         if(att.ParentId.getSobjectType() == Oppportunity.SobjectType){
              OppIds.add(att.ParentId);
         }
    }
    accountList = [select id, hasAttachment__c from Opportunity where id in : OppIds];
    if(OppList!=null && OppList.size()>0){
        for(Opportunity Opp : OppList){
            Opp.hasAttachment__c = true;
        }
        update OppList;
    }
}

It is saying Unexpected Error on List. 
  • August 29, 2016
  • Like
  • 0
Hi Everyone,

I am having some trouble with my .net integration with my salesforce org. Namely the first connection to through the API.

The first connection can take anywhere from 8 - 12 seconds which is quite a while considering its a simple lead creation form, after making the initial connection the interaction with my API is quite fast. I have searched everywhere for a solution to this problem and come up with nothing.

Any suggestions?