• mi5tery
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 10
    Replies

Hi all,

 

I wonder if anyone can help or direct me.

 

I am trying to write my first trigger from scratch (until now I've only really updated existing ones and very rarely at that).

 

I have an object called "Audit" which has a lookup relationship to another object called "Reviewer".

 

What I need to happed is the following.

 

If within the Audit object the lookup for the reviewer changes, then two things need to happen:

 

1. Within the OLD Reviewer object I need to update a field called "Workload" and decrement the value within it by 1.

2. Within the NEW Reviewer object I need to update a field called "Workload" and increment the value within it by 1.

 

(If either old or new are blank/null then do nothing for that step but continue with the other step)

 

I think the above sounds pretty straightforward really but I'm stuck.

 

Any assistance would be gratefully received.

 

Thank you,

 

mi5tery

 

Hi all,

 

I wonder if anyone can help or direct me.

 

I am trying to write my first trigger from scratch (until now I've only really updated existing ones and very rarely at that).

 

I have an object called "Audit" which has a lookup relationship to another object called "Reviewer".

 

What I need to happed is the following.

 

If within the Audit object the lookup for the reviewer changes, then two things need to happen:

 

1. Within the OLD Reviewer object I need to update a field called "Workload" and decrement the value within it by 1.

2. Within the NEW Reviewer object I need to update a field called "Workload" and increment the value within it by 1.

 

(If either old or new are blank/null then do nothing for that step but continue with the other step)

 

I think the above sounds pretty straightforward really but I'm stuck.

 

Any assistance would be gratefully received.

 

Thank you,

 

mi5tery