function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lawlaw 

Need to exclude current offer when query on status

I have an Offer Trigger(before insert before update).   When I change the current offer status to 'Offer Declined'  I need to check to see if there are any other offers  with a status other than 'Offer Declined'. The problem is that my  query returns the exact offer that I just edited  with the  previous Status before I change it to 'offer declined'.  The result should return  NULL as there are no other offers with a Status not equal to 'Offer Declined'.      My query is pulling back the offer with the status before the status was changed.

 

I tried changing the trigger to after update, however this causes an entire section of code not to execute.

 

Any help would be appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
lawlaw
Please disregard... Changing the trigger to fire on After Insert. After Update seems to have resolved the problem. The was some additional code in the trigger I needed to change to reference after instead of before..