• nikola
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi All,
I have a trigger on Opportunity with "before Insert and Before Update"   trigger_events.
The code snippet is given below.

for(Opportunity myOpp : trigger.new)
           {
                  if((Trigger.isUpdate)&&(someother condition))
                            //statements_1
                else if(Trigger.isInsert)
                            //statements_2                                            
          }

In most of the cases,Opportunities are inserted/updated in Bulk using Apex DataLoader.    
  1. If I use UPSERT opertion using DataLoader, will that cause my records to escape from both the IF statements  ??  
  2. Does each record has seperate value for "Trigger.isUpdate" and "Trigger.isInsert" implicit variables??
  3. While UPSERTing using DataLoader, if my first set of values causes an UPDATE and the second causes an INSERT, what would be the values of  Trigger.isUpdate and Trigger.isInsert ??
Please help me to clarify these doubts..

Thanks in Advance,
Krishna
How do I remove triggers created with Eclipse? I delete them from Eclipse but they are still on the Salesforce instance.
 
I have reverted to removing the content from the triggers so they don't do anything, but they are still there firing.
 
Thanks.
 
_t
Hello,
 
Does anybody knows how you can remove a record from trigger.new before the insert? I tried with

System.Trigger.new.remove(i);

But I get the followin error message:

 
19:00:04 INFO - <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="http://soap.sforce.com/2006/08/apex"><soapenv:Body><soapenv:Fault><faultcode>sf:UNKNOWN_EXCEPTION</faultcode><faultstring>UNKNOWN_EXCEPTION: An unexpected error occured. Please include this ErrorId if you contact support: 554952691-62</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
 
Thank you for your help
 
François de Bergeyck