Last Updated on February 10, 2022 by Rakesh Gupta
Big Idea or Enduring Question:
Want to quickly create a new user by cloning an existing user with Public Group, Queue, and Permission Set?
To Clone a record means to replicate it. Salesforce provides an out-of-the-box feature to clone object records – thereby, saving time and enhancing productivity. Generally, if someone wants to clone an Account with an Opportunity they would opt for an Apex Trigger But, we know better! Oh, Ya!
Salesforce provides ‘Clone with Related‘ action. The action makes it simple to create recurring Opportunities and Ca
In the past, I have written a few articles on automating User creation pre and post-process. Why not check them out while you are at it?!
- Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
- Getting Started with Process Builder – Part 19 (Automatically Add New User to Public Group or Queue)
- Getting Started with Process Builder – Part 28 (Auto Freeze Users Account)
- Getting Started with Process Builder – Part 43 (Auto Assign package license to New user)
- Getting Started with Salesforce Flow – Part 36 (Automatically Add New Users to a Chatter Group)
- Getting Started with Salesforce Flow – Part 50 (Welcome New Users by Default – Auto Follow them in Chatter!)
- Getting Started with Process Builder – Part 22 (Discover How to Auto Populate Delegated Approver Field on a New User Record!)
Objectives:
After reading this article, you will be able to:
- Use Flow to deep clone User with Public Group, Queue membership, and associated Permission Sets
- Understand the difference between a Permission Set that is owned by a User (User created) and a permission set that is owned by a Profile (System generated)
- Learn how to use a Decision element to find whether a Record variable or a Record collection variable, contains a record
- Find out how to use the Loop element to create multiple records (or clone records)
- And, last but not least, discover how to use the Create Records element to create multiple records at once (Bulk Safe)
Business Use Case
Steven Greene, a Lead System Administrator at Universal Containers (UC), received a requirement to create an automation that would allow System Administrators to quickly create users by cloning an existing user. In addition, the solution should also allow the Administrators to clone public group and queue memberships including associated permission sets.
To get started we will copy the following fields from an existing User‘s Record:
- TimeZone
- Language
- Locale
- Profile
- Role
- UserLicense
- Email Encoding
- Manager
Allow System Administrators to populate the following fields:
- First Name
- Last Name
- Username
- Alias
- Nickname
Steven envisioned the new Flow screen similar to the following screenshot:
Automation Champion Approach (I-do):
While this can be solved using various automation tools like Apex, etc, we will use Screen Flow.
Before proceeding, you have to understand the PermissionSet objects in Salesforce. It represents an association between a User and a PermissionSet. There are two types of Permission Sets:
- Permission Set that is Owned by User (User created).
- Permission Set that is owned by Profile (System Generated) – Every profile is associated with a permission set that stores the profile’s user, object, and field permissions, as well as setup entity access settings. Permission sets that are owned by profiles can be queried but not modified.
By default, every user will be assigned to a Permission Set that is owned by the Profile, and this Permission Set will not be visible in the User Interface. If you query the Permission Set Assignment object through Workbench, you will retrieve the list of users who are not assigned to any Permission Set (User created). However, know that it is not possible to assign a PermissionSet to a user when the permission set is owned by a profile.
Field Name | Details |
ProfileId | If the permission set is owned by a profile, this field returns the ID of the Profile. |
IsOwnedByProfile | If true, the permission set is owned by a profile |
Take a moment to understand PermissionSetAssignment objects in Salesforce. It represents an association between a User and a PermissionSet.
Field Name | Details |
AssigneeId | The id of the user to assign the permission set. |
PermissionSetId | The Id of the PermissionSet to assign to the user. |
Take a moment to understand Group objects in Salesforce. It represents a sets of users. They can contain individual users, other groups, the users in a particular role or territory, or the users in a particular role or territory plus all the users below that role or territory in the hierarchy.
Field Name | Details |
Name | Name of the group |
Type | Type of the group. One of the following values:
|
Now familiarize yourself with the GroupMember objects in Salesforce. It represents a User or Group that is a member of a public group.
Field Name | Details |
GroupId | The ID of the Group. |
UserOrGroupId | The ID of the User or Group that is a direct member of the group. |
Before diving further, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.
Guided Practice (We-do):
There are 2 steps to solve Steven’s business requirement using Screen Flow and Custom Button. We must:
- Salesforce Flow Steps: (Screen Flow)
- Create a text variable to store existing user Id
- Add a Get Record element to find the old user details
- Add a screen to capture the data for new user
- Add a Create records element to insert a new user
- Add a Decision element to check if a user has been selected to clone permission sets assignments
- Add a Get record element to find the permission set assignments
- Add a Decision element to check the Record collection variable (from step 1.5.1)
- Add a loop element to extract Ids from the record collection variable (from step 1.5.1)
- Add a Decision element to eliminate permission sets that are owned by the profile
- Add an Assignment element to Assign the values into the Record variable
- Add an Assignment element to add the Record variable to a Record collection variable.
- Add a Decision element to check if a user has been selected to clone Public groups and Queue memberships
- Add a Get record element to find the Public Group and Queue Membership
- Add a Decision element to check the Record collection variable (from step 1.6.1)
- Add a Loop element to extract records from the Record collection variable (from step 1.6.1)
- Add a Decision element to determine whether to select Queue vs Public Group Membership based on user selection
- Add an Assignment element to Assign the values into the Record variable
- Add an Assignment element to add the Record variable to a Record collection variable
- Add a Create records element to add a new user to public groups and queues
- Add a Create records element to add permission sets to the new user
- Create a custom button on the user object
Step 1.1: Salesforce Flow – Add a Text Variable to Store Existing User Id
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flow.
- Select the Screen Flow option and click on Next and configure the flow as follows:
- How do you want to start building: Freeform
- Under Toolbox, select Manager, then click New Resource to store the user Id of an existing user.
- Input the following information:
- Resource Type: Variable
- API Name: recordId
- Data Type: Text
- Default Value: {!$GlobalConstant.EmptyString}
- Check Available for Input
- Check Available for Output
- Click Done.
Step 1.2: Salesforce Flow – Adding a Get Record Element to Find the Old User Details
The next step is to use the Get Records element to find the old user details like Name, RoleId, ProfileId, etc.
- Under Toolbox, select Element.
- Drag-and-drop Get Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the User object from the dropdown list.
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Id: Name
- Operator: Equals
- Value: {!recordId}
- Row 1:
- How Many Records to Store:
- select Only the first record
- How to Store Record Data:
- Choose the option to Automatically store all fields.
- Click Done.
Step 1.3: Salesforce Flow – Add a Screen Element to Capture the Data for New User
- Under Toolbox, select Element.
- Select the Screen Flow option and click on Create.
- Under Toolbox, select Elements. Drag and drop Screen onto the canvas.
- Input the following information:
- Enter Label the API Name will auto-populate.
- And then, follow the steps as shown in the video:
- Click Done.
In the end, Steven’s Screen will look like the following screenshot:
Step 1.4: Salesforce Flow – Create Records – Insert a New User
The next step is to create a new user. For this will use the Create Records element.
- Under Toolbox, select Elements. Drag and drop Create Records onto the canvas.
- Input the following information:
- Enter Label the API Name will auto-populate.
- How Many Records to Create: One
- How to Set the Record Fields: Use separate resources, and literal values
- Object: User
- Set Field Values for the User
- Row 1:
- Field: Alias
- Value: {!Alias}
- Add Field
- Row 2
- Field: CommunityNickname
- Value: {!Nickname}
- Add Field
- Row 3
- Field: Email
- Value: {!EmailAddress.value}
- Add Field
- Row 4
- Field: EmailEncodingKey
- Value: {!Old_User.EmailEncodingKey}
- Add Field
- Row 5
- Field: FirstName
- Value: {!$Name.FirstName}
- Add Field
- Row 6
- Field: LanguageLocaleKey
- Value: {!Old_User.LanguageLocaleKey}
- Add Field
- Row 7
- Field: LastName
- Value: {!$Name.LastName}
- Add Field
- Row 8
- Field: LocaleSidKey
- Value: {!Old_User.LocaleSidKey}
- Add Field
- Row 9
- Field: ProfileId
- Value: {!Old_User.ProfileId}
- Add Field
- Row 10
- Field: TimeZoneSideKey
- Value: {!Old_User.TimeZoneSidKey}
- Add Field
- Row 11
- Field: UserRoleId
- Value: {!Old_User.UserRoleId}
- Add Field
- Row 12
- Field: Username
- Value: {!Username.value}
- Row 1:
- Click Done.
Step 1.5: Salesforce Flow – Using Decision Element to Check if a User has been Selected to Clone Permission Sets Assignments
Now we will use the Decision element to check if the system administrator who is cloning the user has been selected to clone permission sets assignments.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (YesClonePermisisonSet) the API Name will auto-populate.
- Update the Default Outcome, enter the Label to DONTClonePermisisonSet.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!PermissionSetAssignments}
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Row 1:
- Click Done.
Step 1.5.1: Salesforce Flow – Adding a Get Record Element to Find the Permission Set Assignments
The next step is to use the Get Records element to find the permission set assignments for the old user.
- Under Toolbox, select Element.
- Drag-and-drop Get Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the Permission Set Assignment object from the dropdown list.
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Field: AssignedId
- Operator: Equals
- Value: {!recordId}
- Row 1:
- How Many Records to Store:
- select All records
- How to Store Record Data:
- Choose the option to Automatically store all fields
- Click Done.
Step 1.5.2: Salesforce Flow – Using Decision Element to Check the Record collection Variable (from step 1.5.1)
Now we will use the Decision element to check the Record Collection Variable from step 1.5.1 to find if it returns the record or not.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (PSAFound) the API Name will auto-populate.
- Update the Default Outcome, enter the Label to PSANotFound.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!Find_Permission_Set_Assignment}
- Operator: Is Null
- Value: {!$GlobalConstant.False}
- Row 1:
- Click Done.
Step 1.5.3: Salesforce Flow – Add a Loop Element to Retrieve Records from Collection Variable (from step 1.5.1)
- Drag-and-drop the Loop element onto the Flow designer.
- Enter a name in the Label (Loop Through PSA) field – the API Name will auto-populate.
- For Collection Variable select {!Find_Permission_Set_Assignment}.
- For Specify Direction for Iterating Over Collection select the option First item to last item.
- Click Done.
Step 1.5.4: Salesforce Flow – Using Decision Element to Eliminate Permission Sets that are Owned by Profile
Now we will use the Decision element to eliminate permission sets that are owned by the profile by checking IsOwnedByProfile field from the permission set.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (NotOwnedByProfile) the API Name will auto-populate.
- Update the Default Outcome, enter the Label to YesOwnedByProfile.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!Loop_Through_PSA.PermissionSet.IsOwnedByProfile}
- Operator: Equals
- Value: {!$GlobalConstant.False}
- Row 1:
- Click Done.
Step 1.5.5: Salesforce Flow – Adding an Assignment Element to Assign the Values into a Record Variable
- Create a Record Variable varRPSA type Permission Set Assignment to link the user with the permission sets.
- Drag-and-drop the Assignment element onto the Flow designer.
- Enter a name in the Label (Map user to PSA) field – the API Name will auto-populate.
- Set Variable Values
- Row 1:
- Field: {!varRPSA.PermissionSetId}
- Operator: Equals
- Value: {!Loop_Through_PSA.PermissionSetId}
- Add Assignment
- Row 2:
- Field: {!varRPSA.AssigneeId}
- Operator: Equals
- Value: {!Create_a_New_User}
- Row 1:
- Click Done.
Step 1.5.6: Salesforce Flow – Adding an Assignment Element to Add the Record Variable to Record Collection Variable
- Create a Record Collection Variable varRPSAs type Permission Set Assignment to store record variable (created in step 1.5.5) for the bulk process.
- Drag-and-drop the Assignment element onto the Flow designer.
- Enter a name in the Label (PSA to a List) field – the API Name will auto-populate.
- Set Variable Values
- Row 1:
- Field: {!varRPSAs}
- Operator: Add
- Value: {!varRPSA}
- Row 1:
- Click Done.
Step 1.6: Salesforce Flow – Using Decision Element to Check if a User has been Selected to Clone Public groups and Queue memberships
Now we will use the Decision element to check if the system administrator who is cloning the user has been selected to clone Public groups and Queue memberships.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (YesCloneGroupMembership) the API Name will auto-populate.
- Update the Default Outcome, enter the Label to DONOTCloneGroupMembership.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!Public_Group_Membership}
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Add Condition
- Row 2:
- Resource: {!Queue_Membership}
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Row 1:
- Click Done.
Step 1.6.1: Lightning Flow – Adding a Get Record Element to Find the Public Group and Queue Membership
The next step is to use the Get Records element to find the Public Group and Queue Membership for the old user.
- Under Toolbox, select Element.
- Drag-and-drop Get Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the GroupMembership object from the dropdown list.
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Field: UserOrGroupId
- Operator: Equals
- Value: {!recordId}
- Row 1:
- How Many Records to Store:
- select All records
- How to Store Record Data:
- Choose the option to Automatically store all fields
- Click Done.
Step 1.6.2: Salesforce Flow – Using Decision Element to Check the Record collection Variable (from step 1.6.1)
Now we will use the Decision element to check the Record Collection Variable from step 1.6.1 to find if it returns the record or not.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (GroupMembershipFound) the API Name will auto-populate.
- Update the Default Outcome, enter the Label to GroupMembershipNOTFound.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!Find_Membership}
- Operator: Is Null
- Value: {!$GlobalConstant.False}
- Row 1:
- Click Done.
Step 1.6.3: Salesforce Flow – Add a Loop Element to Retrieve Records from Record Collection Variable (from step 1.6.1)
- Drag-and-drop the Loop element onto the Flow designer.
- Enter a name in the Label (Loop Through Membership) field – the API Name will auto-populate.
- For Collection Variable select {!Find_Membership}.
- For Specify Direction for Iterating Over Collection select the option First item to last item.
- Click Done.
Step 1.6.4: Salesforce Flow – Using Decision Element to Determine Whether to Select Queue vs Public Group Membership Based on User Selection
Now we will use the Decision element to determine whether to select Queue vs Public Group Membership based on what system administrator has been selected at the time of clone.
- Under Toolbox, select Element.
- Drag-and-drop Decision element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label (Public Group) the API Name will auto-populate.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Under Outcome Details, click on the +
- Enter the Label (Queue) the API Name will auto-populate.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Click Done.
Step 1.6.5: Salesforce Flow – Adding an Assignment Element to Assign the Values into a Record Variable
- Create a Record Variable varRMembership type Group Member to add the user to Public Groups and Queues.
- Drag-and-drop the Assignment element onto the Flow designer.
- Enter a name in the Label (Add User to Public Group or Queue) field – the API Name will auto-populate.
- Set Variable Values
- Row 1:
- Field: {!varRMembership.GroupId}
- Operator: Equals
- Value: {!Loop_Through_Membership.GroupId}
- Add Assignment
- Row 2:
- Field: {!varRMembership.UserOrGroupId}
- Operator: Equals
- Value: {!Create_a_New_User}
- Row 1:
- Click Done.
Step 1.6.6: Salesforce Flow – Adding an Assignment Element to Add the Record Variable to Record Collection Variable
- Create a Record Collection Variable varRMemberships type Group Member to store record variable (created in step 1.6.5) for the bulk process.
- Drag-and-drop the Assignment element onto the Flow designer.
- Enter a name in the Label (Add Memberships into a List) field – the API Name will auto-populate.
- Set Variable Values
- Row 1:
- Field: {!varRMemberships}
- Operator: Add
- Value: {!varRMembership}
- Row 1:
- Click Done.
Step 1.7: Salesforce Flow – Adding a Create Records Element to Add a New User to Public Groups and Queues
- Under Toolbox, select Element.
- Drag-and-drop the Create Records element onto the Flow designer.
- Enter a name in the Label (Add Membership (Queues and Public Groups)) field- the API Name will auto-populate.
- For How Many Records to Create select Multiple.
- Map Record Collection: {!varRMemberships}
- Click Done.
Step 1.8: Salesforce Flow – Adding a Create Records Element to Add Permission Sets to the New User
- Under Toolbox, select Element.
- Drag-and-drop the Create Records element onto the Flow designer.
- Enter a name in the Label (Add Permission Sets) field- the API Name will auto-populate.
- For How Many Records to Create select Multiple.
- Map Record Collection: {!varRPSAs}
- Click Done.
In the end, Steven’s Flow will look like the following screenshot:
Once everything looks good, perform the steps below:
- Click Save.
- Enter Flow Label the API Name will auto-populate.
- Click Show Advanced.
- Type: Screen Flow
- API Version for Running the Flow: 51
- Interview Label: Clone a User {!$Flow.CurrentDateTime}
- Click Save.
Almost there! Once everything looks good, click the Activate button.
Now navigate to the flow details page and copy the Flow URL.
Step 2: Create a Custom Button on the User Object
The next step is to create a custom button (Clone This User) on the User object to call the Flow. We will pass the value to recordId variable.
- Click Setup.
- In the Object Manager, type User.
- Select Buttons, and Links, then click New Button or Link.
- Input the following information:
- Display Type: Detail Page Link
- Select Add Follower to Record as Flow.
- Select Field type: /flow/rakeshistomMVP/Clone_a_User?recordId={!User.Id}
- Click Save.
In the end, make sure to add the button to the user page layout.
Proof of Concept
Now Onwards, a system administrator can quickly create a new user by Cloning an existing user.
- Now click on the Clone This User Link.
- Once the user is created, they are automatically added to the same Public groups, Queue, and also have the same permission set assigned, as shown in the following screenshot:
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.
Error Occurred:
The flow failed to access the value for AddIDs.PermissionSet.IsOwnedByProfile because the field is not available to the running user.
How to avoid this? I am admin and the running user.
You may have to add one or two condition in your filter criteria. Read this article
I get the following error: PermissionSet.IsOwnedByProfile because the field is not available to the running user. What does this mean? I am running as admin user of course. Any ideas? Thanks
Error Occurred:
The flow failed to access the value for AddIDs.PermissionSet.IsOwnedByProfile because the field is not available to the running user.
Hi Rakesh,
Receiving following error when i tried to clone:
An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.
Would you please try pasting the entire error message?
Would this work for portal users too?
I never tested the flow for portal users. I think it will work with little modifications.
Hi Rakesh,
Can you please let us know how to get fast create element in flow. In my flow i couldn’t find fast create element in the palette.
Thanks,
Bhavani
Use get records element
This flow will clone only the logged in user’s permission sets & memberships in groups, queue since we are using !User.Id
How can we clone any other available user with their permission sets in the org?
Your statement is not valid. It will clone the Permission Sets & others from the user record where you clicked the custom link.
Amazing. I’ve used your logic to adapt it to set my own process (uses a custom object to schedule user creation), but now I’m realizing the scheduled aspect doesn’t matter because inserting a user through flow doesn’t trigger the new user email that allows them to reset their password. How are you accounting for that? Do you not have them login directly (using SSO or something) or do you manually go in and reset the password? Thoughts? Thanks!
Hi, in section 1.5.2 I get the following error: PermissionSet.IsOwnedByProfile because the field is not available to the running user. What does this mean? I am running as admin user of course. Any ideas? Thanks
1.5.2 or 1.5.4
I’m getting the same error, what is the solution for that?
I’m getting the same error, what is the solution?
I just tried, and it worked. Would you mind sending me the Flow Error email?
Hi Rakesh,
Very cool! How about permission set groups? Do you need to reference the Developer Name?
Thank you, Scott! For PermissionSetGroups, you have to add complete logic. Yes, use DeveloperName if possible.
Very Helpful Article. I will try to implement this in my org soon for a similar use case.
I’m so happy to hear that, Vibhor! Glad you’ve found this post just as useful 🙂
Hi Rakesh,
The blog is great. I am writing this 6 years later from when you wrote this blog. I have a business case where i need to clone a custom object along with its 3-4 related object records(including all records).I did some research and saw that it can be done via apex and lightning solution.
ls there a way to achieve my above business case using flows in its current capability?
Hi Chandan,
Yes, it is possible to achieve your business case using the blog posts I wrote a few years ago. It is still relevant and working, the logic would be the same.
Good Luck.
I have tried this example but i am getting error as below
ASSIGNMENT: Increment_closedate_15_Days
{!Closedate} Add 15
Result
{!Closedate} = “March 20, 2019”
RECORD CREATE: Create_OPP
Create one Opportunity record where:
AccountId = {!AccountID} (0015A000023heE6)
CloseDate = {!Closedate} (March 20, 2019)
Name = {!OPPName} (Burlington Textiles Weaving Plant Generator)
RecordTypeId = {!RecordID} (0015A000023heE6)
StageName = Prospecting
Result
Failed to create record.
Error Occurred: This error occurred when the flow tried to create records: INVALID_CROSS_REFERENCE_KEY: Record Type ID: this ID value isn’t valid for the user: 0015A000023heE6QAI. You can look up ExceptionCode values in the SOAP API Developer Guide.
This is beacuse of you’re mapping/passiing incorrect ID for the RecordTypeID field.
i am not sure which id is record id , is that 18 digit id of opportunity field , i am bit confused ,
i tried with 18 digit
RECORD CREATE: Create_OPP
Create one Opportunity record where:
AccountId = {!AccountID} (0015A000023heE6)
CloseDate = {!Closedate} (March 20, 2019)
Name = {!OPPName} (Burlington Textiles Weaving Plant Generator)
RecordTypeId = {!RecordID} (0065A00000lsMiGQAU)
StageName = Prospecting
Result
Failed to create record.
Not record ID, make sure that you correctly mapped the RecordTyeID first.
I know this variation will not be practical, but just for the sake of learning, how would you ammend the flow to copy all the opportunities as right now for me is only creating 1
What does means of all the opportunities? Do you want to copy related opportunities of an account?
I tried to test this flow from the account but I received the following error: An unhandled fault has occurred in this flow.
Please post the complete error message
I can’t get my custom button to show on my Lightning Page. It does how in Salesforce Classic. Is it because using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as pre-populating fields when creating a record—doesn’t work in Salesforce1 or Lightning Experience?
I am not sure about Lightning Experience (need time to explorer it) but it should work on Salesforce1.
An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.
Is there a way in Flow to copy the record and all populated fields so that when new fields are added the flows will not have to be remapped? Thanks
Sorry, i am not sure what you are asking. Could you please explain in detail
Hi Rakesh, all of your documentation is very nicely explained. Great work!!!
Thanks for the kind feedback, Ashwin! 🙂
Hi Rakesh Can we Clone a Record from One custom Object to another standard Object when the records get approved
Yes, it is possible to achieve it with the help of Process Builder. Once record gets approved created a process to copy the data into a custom object
What would it look like if there is more than one Opportunity on the Account? Would this only Clone the first Opportunity
Correct, you got it right. If you want to clone more than one opportunity then use Fast Elements ( Fast Lookup, Fast Create etc. )
Do you have any information about what the fast lookup/fast create would look like? Use case is to Clone a Location (custom object) and then clone the equipment and products (also custom objects) on that location. Clearly based on the above I can clone the Location based on your example so thank you. Just wondering about what could be done for equipment and products with fast lookup/create and it’s not intuitive for me.
Record Lookup:-
1) It allows you to save only one record fields value.
2) You can use Variables or SObject Variable to save the record details.
3) One-by-one you have to map the record fields with either Variables or SObject Variable
Fast Lookup:-
1) It allows you to save all the records that, Fast Lookup found after applying the filter criteria.
2) You can use SObject Variable or SObject Collection Variable to save the record details.
3) You don’t have to map the record fields. Here you have just to select the fields whose data you want to save.
Record Create:-
1) It allows you to create one record at a time.
2) You can use Variables or SObject Variable to create a record.
3) One-by-one you have to map the record fields with either Variables or SObject Variable
4) If you use multiple Record Create element in a flow or Record Create element inside Loop element, then it will quickly hit the governor limit
Fast Create:-
1) It allows you to create single or multiple records at a time
2) You can use SObject Variable or SObject Collection Variable to create the record.
3) You don’t have to map the record fields. Here you have just to select the SObject Variable or SObject Collection Variable to create the records.
4) To avoid the governor limits, add the multiple record details into an SObject Collection Variable and refer in a Fast Creat0 element.
Is it possible to clone attachments using Flow?
For instance, attachments on the opportunity (like a proposal) to a custom object?
No
Hi Rakesh,
Nice post !
Could we deep clone it one more level? Like if I want to use opportunity lineitem ?Then, how to achieve this scenario for deeper cloning (multiple levels. I mean to say)
Thanks in advance.
You have to use few more elements in your Flow to clone Opportunity Line Items from an existing Opportunity.
Rakesh,
I would like to clone cases but only want few fields should be cloned. Is there a way I can do using flows or do i need to create trigger?
Thanks,
Richa
You can use Flow to achieve it.
Hi Rakesh,
I tried cloning following the step you stated in above article but I am receiving message
“Your flow doesn’t have a Start element assigned. “
Set a start element in your flow. Take a look of this article to know how to set flow’s start element https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_elements_start.htm