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
Ayush Jain 116Ayush Jain 116 

Apex trigger created on contact not working for flow

I have created an Apex Trigger for a contact created using flow builder. I am creating it using Peson Account which creates a contact. My trigger is not working for this contact but it is working when i create a contact manually. 

User-added imageI have verifed the Flow and it is working fine, i can see the converted contacts in CRM. But the trigger doesn't work when the contact is created.

Only reason i can think of is Contact created from Person Account is not able to invoke the trigger but i am not sure.

Please Help

 

Best Answer chosen by Ayush Jain 116
Shiraz HodaShiraz Hoda
Hi Ayush,
In some scenarios trigger does not fire or fires differently. For example see below case.
Inserts, updates, and deletes on person accounts fire Account triggers, not Contact triggers.

For for information, See below salesforce documentation.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_ignoring_operations.htm

Kindly mark it as best answer if it resolves your issue.

Regards,
Shiraz
 

All Answers

Shiraz HodaShiraz Hoda
Hi Ayush,
In some scenarios trigger does not fire or fires differently. For example see below case.
Inserts, updates, and deletes on person accounts fire Account triggers, not Contact triggers.

For for information, See below salesforce documentation.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_ignoring_operations.htm

Kindly mark it as best answer if it resolves your issue.

Regards,
Shiraz
 
This was selected as the best answer
Ayush Jain 116Ayush Jain 116

Hi shiraz,
Thanks a lot for your solution. 
Your solution is indeed accurate and helped me a lot.
Regards,
Ayush