• adam rop
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am trying to pass a prior value as a param to a flow that I need to call from apex because I need to cover the inability to deal with deleted records without apex triggers.  Can someone lend guidance as to how to access a record's prior value? thanks

I need something like this (I know it's not that simple)

  For (Animal_Location_History__c Animal : Trigger.Old) {
      // Call the Flow
        Map<String, Object> params2 = new Map<String, Object>();
        params2.put('varInputAnimalLocation', Animal_Location_History__c.Animal_Location__c);
        params2.put('varPriorLocation', PRIORVALUE(Animal_Location_History__c.Animal_Location__c));
        params2.put('varInputAnimalLocation', Animal_Location_History__c.Location__r.Id);
           Flow.Interview.Update_Location_Inventory Update_Location_Inventory = new Flow.Interview.Update_Location_Inventory(params2);
        Update_Location_Inventory.start();
        // System.debug('Animal Location '  + Animal_Location_History__c.Animal_Location__c    );
        
        }