You need to sign in to do that
Don't have an account?
Ayush Jain 116
Apex Trigger on contact object created from flow
I am unable to trigger an Apex trigger on contact object (getting created from a flow ) with 'after insert' condition. My trigger doesn't recognise the contact created from the flow and it doesn't work.
I have tested the trigger by manually creating a contact and it was working well.
here is the flow for the
My goal is to fetch the Contact ID into a trigger. Please suggest some solutions.
Hi,
Thanks a lot for your time I found this blog and it is mentioned here that "Inserts, updates, and deletes on person accounts fire Account triggers, not Contact triggers."
So, I think if I create an account trigger with a field to carry the contact id. i might be able to do the triggering.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_ignoring_operations.htm
I really appreciate your helping nature.
Thanks,
All Answers
Is the flow working as expected and creating the Contact succesfully. Usually it should trigger the Contact Trigger.
Thanks,
Thanks for responding Praveen,
I have checked multiple times and the flow is working fine.
For this flow i need to create a lead with specific ownerId and then it creates an account then contact and then delete the lead. I have checked in the CRM and i am able to find the newly created contact but the trigger doesn't work for it ( i have checked the logs ).
Can you confirm what type of flow you created so I can check the same in my org and check it.
Thanks,
Hi Praveen,
I have created a Record-Triggered Flow, which is triggered when a lead with specific OwnerId is created.
It checks for duplication and then creates a prospect account then contact and then deletes the lead...
I am able to verify that after creating a lead a contact is created. I don't understand why the trigger is not working for this scenario.
Thanks,
Hi Praveen,
This is the new Flow i have created. I am creating a person account using flow and that person account in turn creates a contact. I want to place a trigger for that contact.
Is Contact Trigger working if you create a personal Account manually?
Thanks,
No, when i created a person account manually, a contact is created automatically but the trigger didn't work on it.
I guess the problem is with this person account.
Do you have a solution for that ?
Can you share the trigger so I can check it.
Thanks,
Hi,
Thanks a lot for your time I found this blog and it is mentioned here that "Inserts, updates, and deletes on person accounts fire Account triggers, not Contact triggers."
So, I think if I create an account trigger with a field to carry the contact id. i might be able to do the triggering.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_ignoring_operations.htm
I really appreciate your helping nature.
Thanks,