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 

How do I query the a custom object and not included the current record

I have a trigger on the a custom object called offer.  Within this trigger I need to verify that ther exist no OTHER offers with the same status as the current Offer.  There is only one offer, this is the current offer.  I create a map to store the results and this one offer is of course in the map.

 

How do I disregard the current record when its included in the map.

Sam MohyeeSam Mohyee
Can you clarify what your intention is?

Do you want your SOQL query to not return the offer that set off the trigger? In that case make sure your SOQL query has something like
WHERE ID != :Trigger.New

Trigger.New returns IDs of every record that set off the trigger, aka the 'current' offer.