• Keegan
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
I'm working with a trigger that pulls the value from formula fields and adds it to other fields. The trigger runs when a date is changed on a parent record. The weird thing is that when I change the date the first time, the trigger works perfectly. When I change the date a second time, the trigger runs but the fields are updated with the old value instead of the new. When I change the date a third time, the trigger works perfectly again.
Example:
Date Change to 7/1
Old field value 1000, Formula value change to 1100, New field value 1100 
Date Change to 7/2
Old field value 1100, Formula value change to 1200, New field value 1100
Date Change 7/3
Old field value 1100, Formula value change to 1300, New field value 1300
etc. ect.

I thought it was a problem with my trigger being a before update trigger but if that was the issue, why does it work evey other time? My trigger is below.

trigger CopyFieldsonOutstanding on Outstanding_Balance__c (before insert, before update) {
    for(Outstanding_Balance__c outstanding: trigger.new) {
     //Field that you want to be copied by other field keep those on left side
      outstanding.Days_Drop__c = outstanding.Days__c;    
      outstanding.A_Interest_Past_Roll__c = outstanding.Accrued_Interest_Past__c; 
      outstanding.Accrued_Interest_Drop__c = outstanding.Accrued_Interest__c; 
      outstanding.Drop_Min__c = outstanding.MinorMax__c; 
      outstanding.Filter_Days_Drop__c = outstanding.Days_Filtered__c; 
      outstanding.Filtered_Earned_Rollup__c = outstanding.Filtered_Earned_Income__c; 
      outstanding.Test_Interest_Income_Rollup__c = outstanding.Test_Interest_Income__c; 
      outstanding.Interest_Income_Rollup__c = outstanding.Interest_Income__c; 
      outstanding.Interest_Past_Roll__c = outstanding.Interest_Income_Past__c; 
      outstanding.Rate_Drop__c = outstanding.Interest_Rate__c; 
      outstanding.Today__c = outstanding.Between__c; 
    }
}

Is something wrong with my trigger? If I need to change it to after update, can you please tell me how to test the trigger because the tests I have tried to run on it (when I tried to change it to an after update trigger) keep failing.

Thanks!
Hello,
I have a flow which needs to compare to dates using greater then, less then, and equal to. For some reason my comparisons aren't working. For example, even when I say Start_Date less then loanvardate. It still brings in records where the start date is equal to loan var date. Is there something I am doing wrong?
User-added image
Also, I have an record update that seems to create a new record everytime instead of editing the record (the above lookup is set to the currentoutstanding variable). What would cause this to happen?
User-added image
Thanks!

 
Hello,
I was stupid and edited a process builder flow in visual flow which of course means that I can no longer see the flow in either. I tried using workbench to see the flow and its versions so I can at least make it inactive (since it is stopping all my other flows from running) but it doesn't show up. All my other flows are there but that one is missing. When I use Rest Explorer, I can find the active version of the flow since I have the id but I don't know the ids for the inactive versions so I can't delete anything or deactivate anything.

Can someone please tell me how I can either deactive an active version through Rest Explorer or how to find the ids of the inactive versions of the flow when it won't show up in workbench metadeta?

Thanks.
  • February 16, 2018
  • Like
  • 0
I'm working with a trigger that pulls the value from formula fields and adds it to other fields. The trigger runs when a date is changed on a parent record. The weird thing is that when I change the date the first time, the trigger works perfectly. When I change the date a second time, the trigger runs but the fields are updated with the old value instead of the new. When I change the date a third time, the trigger works perfectly again.
Example:
Date Change to 7/1
Old field value 1000, Formula value change to 1100, New field value 1100 
Date Change to 7/2
Old field value 1100, Formula value change to 1200, New field value 1100
Date Change 7/3
Old field value 1100, Formula value change to 1300, New field value 1300
etc. ect.

I thought it was a problem with my trigger being a before update trigger but if that was the issue, why does it work evey other time? My trigger is below.

trigger CopyFieldsonOutstanding on Outstanding_Balance__c (before insert, before update) {
    for(Outstanding_Balance__c outstanding: trigger.new) {
     //Field that you want to be copied by other field keep those on left side
      outstanding.Days_Drop__c = outstanding.Days__c;    
      outstanding.A_Interest_Past_Roll__c = outstanding.Accrued_Interest_Past__c; 
      outstanding.Accrued_Interest_Drop__c = outstanding.Accrued_Interest__c; 
      outstanding.Drop_Min__c = outstanding.MinorMax__c; 
      outstanding.Filter_Days_Drop__c = outstanding.Days_Filtered__c; 
      outstanding.Filtered_Earned_Rollup__c = outstanding.Filtered_Earned_Income__c; 
      outstanding.Test_Interest_Income_Rollup__c = outstanding.Test_Interest_Income__c; 
      outstanding.Interest_Income_Rollup__c = outstanding.Interest_Income__c; 
      outstanding.Interest_Past_Roll__c = outstanding.Interest_Income_Past__c; 
      outstanding.Rate_Drop__c = outstanding.Interest_Rate__c; 
      outstanding.Today__c = outstanding.Between__c; 
    }
}

Is something wrong with my trigger? If I need to change it to after update, can you please tell me how to test the trigger because the tests I have tried to run on it (when I tried to change it to an after update trigger) keep failing.

Thanks!
Hello,
I have a flow which needs to compare to dates using greater then, less then, and equal to. For some reason my comparisons aren't working. For example, even when I say Start_Date less then loanvardate. It still brings in records where the start date is equal to loan var date. Is there something I am doing wrong?
User-added image
Also, I have an record update that seems to create a new record everytime instead of editing the record (the above lookup is set to the currentoutstanding variable). What would cause this to happen?
User-added image
Thanks!

 
Hello,
I was stupid and edited a process builder flow in visual flow which of course means that I can no longer see the flow in either. I tried using workbench to see the flow and its versions so I can at least make it inactive (since it is stopping all my other flows from running) but it doesn't show up. All my other flows are there but that one is missing. When I use Rest Explorer, I can find the active version of the flow since I have the id but I don't know the ids for the inactive versions so I can't delete anything or deactivate anything.

Can someone please tell me how I can either deactive an active version through Rest Explorer or how to find the ids of the inactive versions of the flow when it won't show up in workbench metadeta?

Thanks.
  • February 16, 2018
  • Like
  • 0