You need to sign in to do that
Don't have an account?
Ab
Trigger | Populating Id of currently Inserted or Updated Contact
Hello,
trigger triggerTest on Contact (after insert, after update) { Set<Id> contactIds = new Set<Id>(); for (Contact obj : Trigger.new) { contactIds.add(obj.Id); } contactIds.remove(null); System.debug(contactIds);//This line gives me 6 repeated ids for contact, I want to get only one what is the reason
You need to create a class and define a statck Property.
For example. In your trigger
-Thanks
Ashlekh Gera
All Answers
And you need to check when you update or insert the contact, there is any other logic in code which update the other contacts or not.
-Thanks
Ashlekh Gera
I think that, the trigger is recursively calling itself as in the end of the trigger, i update a field on the same contact.
How can i make the trigger execute only onces and not for future updates
You need to create a class and define a statck Property.
For example. In your trigger
-Thanks
Ashlekh Gera
Hi AKG,
what can be test class for
-Thanks
Ashlekh Gera