• Blobmob
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Could someone help me?

 

I created the following trigger.

 

trigger RFTSetPDStatus on RFT_Category__c (before insert, before update) {
  if (Trigger.isInsert)
  { 
    for(RFT_Category__c pd:Trigger.new)
    {
        pd.PD_Status__c='Open';      
    }
  }
  if (Trigger.isUpdate)
  {
    Integer msExist=null;
    Integer msCnt=null;  
    for(RFT_Category__c pd:Trigger.new)
    {
        msExist=[SELECT COUNT() FROM Ichthys_RFT__c WHERE RFT_Category__r.Id = :pd.Id];
        if(msExist==0)
        {
          pd.PD_Status__c ='Open';
        }
        else
        {
          msCnt = [SELECT COUNT() FROM Ichthys_RFT__c WHERE RFT_Category__r.Id = :pd.Id AND Status__c <>'Completed'];
          if(msCnt==0)
          {
            pd.PD_Status__c ='Close';
          }
          else if(msCnt>0)
          {
            pd.PD_Status__c ='Open';
          }
        }
    }
  }
}

 

When I try to update over 1500 data from Apex Dataloader,

the error "System.LimitException: Too many SOQL queries: 101" occurred.

So I split data into 50 and updated them. 

Is there any way to update over 1500 data by changing this trigger code?

 

Thanks in advance for your support!

 

Anna

  • February 22, 2013
  • Like
  • 0

Hello,

 

i want to get the Email Address from the orignal Sender

for Example Person A send a mail to Emailprogram B and this send the Mail To C Salesforce Email Service.

Now I want to get in SF the Emailaddress from Person A.

When I try to print out the Header 

 

  for (Messaging.InboundEmail.Header header : email.headers) {

...

 i get  header name and value form B not from A. How can I get the Address form A

If i Look the Source Email before i Send to SF, there is a Key with Received with the Address, but in SF is not there?

How can i get fix this?

 

Chris