• Miguel Gonzalez 4
  • NEWBIE
  • 10 Points
  • Member since 2014
  • IT-Applications Specialist

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have a working Apex trigger that is set to fire whenever someone tries to edit an existing case's FTP Actions field.  Here is the coding as it stands now:
trigger UpdateFTPCases on FTP_Action__c (after insert) {
    List<Case> updtCases = new List<Case>();
    
    for(FTP_Action__c f : Trigger.new){
        //After Insert trigger area
        if (f.FTP_to_Case__c != null && f.Action_Date_Time__c != null) {
            updtCases.add(new Case(
                Id = f.FTP_to_Case__c,
                Last_Upload__c = f.Action_Date_Time__c));
                }
        }
            if (!updtCases.isEmpty()) {
            update updtCases;
    }   
        
}

This trigger has been tested and unit tested and works fine.  My manager would like to see if we can add in a Handler class and adjust the code as necessary.  This is just us playing around with Triggers and there are no plans to use these in production.  Being written for Sandbox use only.

I'm working on a trigger project in the Sandbox.  It's supposed to set off anytime someone updates the field "FTP_to_Case__c" on "FTP Actions".  I have the initial stage, to set activate the trigger, set up, but I'm new to SFDC and how to take that "Action_Date_Time__c" data collected and transfer it to my new custom object "Last_Upload" (which is on the object "Case") is where I'm a bit lost. 

Here is where I stand so far.
My coding for an Apex Trigger...so far.  I've declared the List, what I want to initiate the Trigger, and the Update command.
Any guidance will be much appreciated!

Miguel G.

I'm working on a trigger project in the Sandbox.  It's supposed to set off anytime someone updates the field "FTP_to_Case__c" on "FTP Actions".  I have the initial stage, to set activate the trigger, set up, but I'm new to SFDC and how to take that "Action_Date_Time__c" data collected and transfer it to my new custom object "Last_Upload" (which is on the object "Case") is where I'm a bit lost. 

Here is where I stand so far.
My coding for an Apex Trigger...so far.  I've declared the List, what I want to initiate the Trigger, and the Update command.
Any guidance will be much appreciated!

Miguel G.