• Cory Payne
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 11
    Replies
I have a simple Apex Trigger to pass data to an external system, and I'm wondering if it is possible to add a filter criteria to exclude updates made by a specific user account?

Trigger eOne_SC_RTDS_Opportunity_U on Opportunity (after update) {
set<ID> ids = Trigger.newMap.keyset(); 
eOne_SC_RTDS.Process('Opportunity','update',ids); 
}
I was provided a Trigger for a custom object called Transaction__c, looking for a Test Step to be able to deploy this to Production?  I'm hoping it would be quick/easy but not sure how to proceed...help?

trigger eOne_SC_RTDS_Transaction_C_I on Transaction__c (after insert) {
set<ID> ids = Trigger.newMap.keyset();
    eOne_SC_RTDS.Process('Transaction__c','insert',ids);
}
Hello, total coding noob and trying to simply copy an Opportunity picklist value to a lookup field that is on the same Opportunity; the lookup is to a custom object called Warehouse__c.  I've scoured the forums for coding examples and thought I found what I needed but I am getting an error message in the Apex Trigger editor.

Source field is Opportunity.FMAV_Selling_Office__c (picklist)
Destination field is Opportunity.Selling_Office__c which is a lookup to a custom object Warehouse__c
Picklist values exactly match record names on Warehouse object.

Here is what I have so far?
Trigger GrabReference on Opportunity (before insert, before update)  
{    for (Opportunity dp: trigger.new) {
       if(Opportunity.FMAV_Selling_Office__c != null) {  
        //queries for 1 record's ID, being the record ID where the dpas.Name field is the same as the dp.picklist field that fired the trigger
           List<Warehouse__c> dpas = new List<Warehouse__c>(); 
           dpas = [Select Id from Warehouse__c WHERE Warehouse__c.Name = :Opportunity.FMAV_Selling_Office__c ORDER BY Id LIMIT 1];
           // and if we got back anything...
              if (dpas.size() > 0){
            //set your dp.reference field equal to the returned record's ID
                 Opportunity.Selling_Office__c = dpas[0].Id;
              }        
       }
    }
    }

Help?
Hello, total coding noob and trying to simply copy an Opportunity picklist value to a lookup field that is on the same Opportunity; the lookup is to a custom object called Warehouse__c.  I've scoured the forums for coding examples and thought I found what I needed but I am getting an error message in the Apex Trigger editor.

Source field is Opportunity.FMAV_Selling_Office__c (picklist)
Destination field is Opportunity.Selling_Office__c which is a lookup to a custom object Warehouse__c
Picklist values exactly match record names on Warehouse object.

Here is what I have so far?
Trigger GrabReference on Opportunity (before insert, before update)  
{    for (Opportunity dp: trigger.new) {
       if(Opportunity.FMAV_Selling_Office__c != null) {  
        //queries for 1 record's ID, being the record ID where the dpas.Name field is the same as the dp.picklist field that fired the trigger
           List<Warehouse__c> dpas = new List<Warehouse__c>(); 
           dpas = [Select Id from Warehouse__c WHERE Warehouse__c.Name = :Opportunity.FMAV_Selling_Office__c ORDER BY Id LIMIT 1];
           // and if we got back anything...
              if (dpas.size() > 0){
            //set your dp.reference field equal to the returned record's ID
                 Opportunity.Selling_Office__c = dpas[0].Id;
              }        
       }
    }
    }

Help?
I have a simple Apex Trigger to pass data to an external system, and I'm wondering if it is possible to add a filter criteria to exclude updates made by a specific user account?

Trigger eOne_SC_RTDS_Opportunity_U on Opportunity (after update) {
set<ID> ids = Trigger.newMap.keyset(); 
eOne_SC_RTDS.Process('Opportunity','update',ids); 
}
I was provided a Trigger for a custom object called Transaction__c, looking for a Test Step to be able to deploy this to Production?  I'm hoping it would be quick/easy but not sure how to proceed...help?

trigger eOne_SC_RTDS_Transaction_C_I on Transaction__c (after insert) {
set<ID> ids = Trigger.newMap.keyset();
    eOne_SC_RTDS.Process('Transaction__c','insert',ids);
}
Hello, total coding noob and trying to simply copy an Opportunity picklist value to a lookup field that is on the same Opportunity; the lookup is to a custom object called Warehouse__c.  I've scoured the forums for coding examples and thought I found what I needed but I am getting an error message in the Apex Trigger editor.

Source field is Opportunity.FMAV_Selling_Office__c (picklist)
Destination field is Opportunity.Selling_Office__c which is a lookup to a custom object Warehouse__c
Picklist values exactly match record names on Warehouse object.

Here is what I have so far?
Trigger GrabReference on Opportunity (before insert, before update)  
{    for (Opportunity dp: trigger.new) {
       if(Opportunity.FMAV_Selling_Office__c != null) {  
        //queries for 1 record's ID, being the record ID where the dpas.Name field is the same as the dp.picklist field that fired the trigger
           List<Warehouse__c> dpas = new List<Warehouse__c>(); 
           dpas = [Select Id from Warehouse__c WHERE Warehouse__c.Name = :Opportunity.FMAV_Selling_Office__c ORDER BY Id LIMIT 1];
           // and if we got back anything...
              if (dpas.size() > 0){
            //set your dp.reference field equal to the returned record's ID
                 Opportunity.Selling_Office__c = dpas[0].Id;
              }        
       }
    }
    }

Help?