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
PkPk 

Help with a task, I would be happy both through the system (Flow) and through Apex


1. Create a new field on Case: Name: Owners Manager Email Type:    Email  

2. Create a Flow (autolaunched) and a Process Builder:  Flow Name: Case Owner Manager Email Flow Description: This flow is used to update Owners Manager Email field when Case is created or when the case owner is changed. Logic:

1. Check if the case owner is a User or a Queue.

2. If the owner is a Queue, or a User that has no manager, do nothing.

3. Else (the owner is a user with a manager), populate the field "Owners Manager Email" with the email of the owners Manager.  

PB Name: Case PB Criteria: When Case is created or the case Owner is changed. Action: Launch Flow.

3. Create a Screen Flow & Action: Flow Name: Create Contact Flow Description: Screen flow to make it easier to create a contact.

Logic:

1. Show a screen with those contact fields:  First name, Last name, Mobile and Email.

2. Check if a contact with the same mobile OR email already exist in the system.

3. If such contact already exists, show a screen "Contact already exist for Account xxxx" where xxxx is the Account name of that contact.

4. If the  contact does not exist, create new contact under the current
Account.

Create an Action on Account object that will launch the above flow OR put the flow on the Account Lightning page. 

Thank you very much.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Patrick,

This seems to be duplicate for the below question. Can you close this question by marking this as best answer so it avoids duplicate efforts of the developers.

https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Apex_Code_Development&criteria=ALLQUESTIONS&id=9062I000000UiV4

Thanks,