Clone a User with their associated Public Group, Queue Membership and Permission Sets

Clone a User with their associated Public Group, Queue Membership and Permission Sets

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 productivityGenerally, 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 Campaigns By using the action, your Account reps will spare themselves from the trouble of finding and adding related items onebyone to re-create the records. Unfortunately, Salesforce doesn’t have Clone with Related action for the User object Therefore, in this article, I will show you how to configure a deep clone feature in your org.

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?! 

  1. Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
  2. Getting Started with Process Builder – Part 19 (Automatically Add New User to Public Group or Queue)
  3. Getting Started with Process Builder – Part 28 (Auto Freeze Users Account)
  4. Getting Started with Process Builder – Part 43 (Auto Assign package license to New user)
  5. Getting Started with Salesforce Flow – Part 36 (Automatically Add New Users to a Chatter Group)
  6. Getting Started with Salesforce Flow – Part 50 (Welcome New Users by Default – Auto Follow them in Chatter!)
  7. 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:

  1. TimeZone
  2. Language
  3. Locale
  4. Profile
  5. Role
  6. UserLicense
  7. Email Encoding
  8. Manager

Allow System Administrators to populate the following fields:

  1. First Name
  2. Last Name
  3. Email
  4. Username
  5. Alias
  6. 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:

  1. Permission Set that is Owned by User (User created).
  2. 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:
  • Queue
  • Public group

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. 

Let’s begin building this automation process.

Guided Practice (We-do):

There are 2 steps to solve Steven’s business requirement using Screen Flow and Custom Button. We must:

  1. Salesforce Flow Steps: (Screen Flow)
    1. Create a text variable to store existing user Id 
    2. Add a Get Record element to find the old user details
    3. Add a screen to capture the data for new user
    4. Add a Create records element to insert a new user
    5. Add a Decision element to check if user has been selected to clone permission sets assignments
      1. Add a Get record element to find the permission set assignments 
      2. Add a Decision element to check the Record collection variable (from step 1.5.1)
      3. Add a loop element to extract Ids from the record collection variable (from step 1.5.1) 
      4. Add a Decision element to eliminate permission sets that are owned by the profile 
      5. Add an Assignment element to Assign the values into the Record variable
      6. Add an Assignment element to add the Record variable to a Record collection variable.
    6. Add a Decision element to check if user has been selected to clone Public groups and Queue memberships 
      1. Add a Get record element to find the Public Group and Queue Membership 
      2. Add a Decision element to check the Record collection variable (from step 1.6.1)
      3. Add a Loop element to extract records from the Record collection variable (from step 1.6.1)
      4. Add a Decision element to determine whether to select Queue vs Public Group Membership based on user selection 
      5. Add an Assignment element to Assign the values into the Record variable
      6. Add an Assignment element to add the Record variable to a Record collection variable
    7. Add a Create records element to add a new user to public groups and queues
    8. Add a Create records element to add permission sets to the new user 
  2. Create a custom button on the user object

Step 1.1: Salesforce Flow – Add a Text Variable to Store Existing User Id

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows then click on the New Flow.
  4. Select the Screen Flow option and click on Next and configure the flow as follows: 
    1. How do you want to start building: Freeform
  5. Under Toolbox, select Manager, then click New Resource to store the user Id of an existing user. 
  6. Input the following information: 
    1. Resource Type: Variable
    2. API Name: recordId
    3. Data Type: Text
    4. Default Value: {!$GlobalConstant.EmptyString}
    5. Check Available for Input
    6. Check Available for Output
  7. 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, ProfileIdetc.

  1. Under Toolbox, select Element
  2. Drag-and-drop Get Records element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Select the User object from the dropdown list.
  5. Select All Conditions Are Met (AND)
  6. Set Filter Conditions
    1. Row 1:
      1. Id: Name
      2. Operator: Equals
      3. Value: {!recordId}
  7. How Many Records to Store:
    1. select Only the first record
  8. How to Store Record Data:
    1. Choose the option to Automatically store all fields
  9. Click Done.

Step 1.3: Salesforce Flow – Add a Screen Element to Capture the Data for New User

  1. Under Toolbox, select Element
  2. Select the Screen Flow option and click on Create.
  3. Under Toolbox, select Elements. Drag and drop Screen onto the canvas. 
  4. Input the following information:
    1. Enter Label the API Name will auto-populate.
  5. And then, follow the steps as shown in the video:
  6. 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. 

  1. Under Toolbox, select Elements. Drag and drop Create Records onto the canvas. 
  2. Input the following information:
    1. Enter Label the API Name will auto-populate.
    2. How Many Records to Create: One
    3. How to Set the Record Fields: Use separate resources, and literal values
    4. Object: User
    5. Set Field Values for the User
      1. Row 1:
        1. Field: Alias
        2. Value: {!Alias}
      2. Add Field
      3. Row 2
        1. Field: CommunityNickname
        2. Value: {!Nickname}
      4. Add Field
      5. Row 3
        1. Field: Email
        2. Value: {!EmailAddress.value}
      6. Add Field
      7. Row 4
        1. Field: EmailEncodingKey
        2. Value: {!Old_User.EmailEncodingKey}
      8. Add Field
      9. Row 5
        1. Field: FirstName
        2. Value: {!$Name.FirstName}
      10. Add Field
      11. Row 6
        1. Field: LanguageLocaleKey
        2. Value: {!Old_User.LanguageLocaleKey}
      12. Add Field
      13. Row 7
        1. Field: LastName
        2. Value: {!$Name.LastName}
      14. Add Field
      15. Row 8
        1. Field: LocaleSidKey
        2. Value: {!Old_User.LocaleSidKey}
      16. Add Field
      17. Row 9
        1. Field: ProfileId
        2. Value: {!Old_User.ProfileId}
      18. Add Field
      19. Row 10
        1. Field: TimeZoneSideKey
        2. Value: {!Old_User.TimeZoneSidKey}
      20. Add Field
      21. Row 11
        1. Field: UserRoleId
        2. Value: {!Old_User.UserRoleId}
      22. Add Field
      23. Row 12
        1. Field: Username
        2. Value: {!Username.value}
  3. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (YesClonePermisisonSet) the API Name will auto-populate.
    1. Update the Default Outcome, enter the Label to DONTClonePermisisonSet.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!PermissionSetAssignments}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.True}
  6. 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.

  1. Under Toolbox, select Element
  2. Drag-and-drop Get Records element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Select the Permission Set Assignment object from the dropdown list.
  5. Select All Conditions Are Met (AND)
  6. Set Filter Conditions
    1. Row 1:
      1. Field: AssignedId
      2. Operator: Equals
      3. Value: {!recordId}
  7. How Many Records to Store:
    1. select All records
  8. How to Store Record Data:
    1. Choose the option to Automatically store all fields
  9. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (PSAFound) the API Name will auto-populate.
    1. Update the Default Outcome, enter the Label to PSANotFound.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Find_Permission_Set_Assignment}
      2. Operator: Is Null 
      3. Value: {!$GlobalConstant.False}
  6. Click Done.

Step 1.5.3: Salesforce Flow –  Add a Loop Element to Retrieve Records from Collection Variable (from step 1.5.1) 

  1. Drag-and-drop the Loop element onto the Flow designer. 
  2. Enter a name in the Label (Loop Through PSA) field – the API Name will auto-populate.
  3. For Collection Variable select {!Find_Permission_Set_Assignment}.
  4. For Specify Direction for Iterating Over Collection select the option First item to last item.
  5. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (NotOwnedByProfile) the API Name will auto-populate.
    1. Update the Default Outcome, enter the Label to YesOwnedByProfile.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Loop_Through_PSA.PermissionSet.IsOwnedByProfile}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.False}
  6. Click Done.

Step 1.5.5: Salesforce Flow – Adding an Assignment Element to Assign the Values into a Record Variable

  1. Create a Record Variable varRPSA type Permission Set Assignment to link the user with the permission sets.
  2. Drag-and-drop the Assignment element onto the Flow designer. 
  3. Enter a name in the Label (Map user to PSA) field – the API Name will auto-populate.
  4. Set Variable Values
    1. Row 1:
      1. Field: {!varRPSA.PermissionSetId}
      2. Operator: Equals
      3. Value: {!Loop_Through_PSA.PermissionSetId}
    2. Add Assignment 
    3. Row 2:
      1. Field: {!varRPSA.AssigneeId}
      2. Operator: Equals
      3. Value: {!Create_a_New_User}
  5. Click Done.

Step 1.5.6: Salesforce Flow – Adding an Assignment Element to Add the Record Variable to Record Collection Variable

  1. Create a Record Collection Variable varRPSAs type Permission Set Assignment to store record variable (created in step 1.5.5) for the bulk process.
  2. Drag-and-drop the Assignment element onto the Flow designer. 
  3. Enter a name in the Label (PSA to a List) field – the API Name will auto-populate.
  4. Set Variable Values
    1. Row 1:
      1. Field: {!varRPSAs}
      2. Operator: Add
      3. Value: {!varRPSA}
  5. 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.

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (YesCloneGroupMembership) the API Name will auto-populate.
    1. Update the Default Outcome, enter the Label to DONOTCloneGroupMembership.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Public_Group_Membership}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.True}
    2. Add Condition
    3. Row 2:
      1. Resource: {!Queue_Membership}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.True}
  6. 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.

  1. Under Toolbox, select Element
  2. Drag-and-drop Get Records element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Select the GroupMembership object from the dropdown list.
  5. Select All Conditions Are Met (AND)
  6. Set Filter Conditions
    1. Row 1:
      1. Field: UserOrGroupId
      2. Operator: Equals
      3. Value: {!recordId}
  7. How Many Records to Store:
    1. select All records
  8. How to Store Record Data:
    1. Choose the option to Automatically store all fields
  9. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (GroupMembershipFound) the API Name will auto-populate.
    1. Update the Default Outcome, enter the Label to GroupMembershipNOTFound.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Find_Membership}
      2. Operator: Is Null 
      3. Value: {!$GlobalConstant.False}
  6. Click Done.

Step 1.6.3: Salesforce Flow –  Add a Loop Element to Retrieve Records from Record Collection Variable (from step 1.6.1) 

  1. Drag-and-drop the Loop element onto the Flow designer. 
  2. Enter a name in the Label (Loop Through Membership) field – the API Name will auto-populate.
  3. For Collection Variable select {!Find_Membership}.
  4. For Specify Direction for Iterating Over Collection select the option First item to last item.
  5. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label (Public Group) the API Name will auto-populate.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Loop_Through_Membership.Group.Type}
      2. Operator: Equals
      3. Value: Regular
    2. Add Condition
    3. Row 2:
      1. Resource: {!Public_Group_Membership}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.True}
  6. Under Outcome Details, click on the +
  7. Enter the Label (Queue) the API Name will auto-populate.
  8. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Loop_Through_Membership.Group.Type}
      2. Operator: Equals
      3. Value: Queue
    2. Add Condition
    3. Row 2:
      1. Resource: {!Queue_Membership}
      2. Operator: Equals
      3. Value: {!$GlobalConstant.True}
  9. Click Done.

Step 1.6.5: Salesforce Flow – Adding an Assignment Element to Assign the Values into a Record Variable

  1. Create a Record Variable varRMembership type Group Member to add the user to Public Groups and Queues.
  2. Drag-and-drop the Assignment element onto the Flow designer. 
  3. Enter a name in the Label (Add User to Public Group or Queue) field – the API Name will auto-populate.
  4. Set Variable Values
    1. Row 1:
      1. Field: {!varRMembership.GroupId}
      2. Operator: Equals
      3. Value: {!Loop_Through_Membership.GroupId}
    2. Add Assignment 
    3. Row 2:
      1. Field: {!varRMembership.UserOrGroupId}
      2. Operator: Equals
      3. Value: {!Create_a_New_User}
  5. Click Done.

Step 1.6.6: Salesforce Flow – Adding an Assignment Element to Add the Record Variable to Record Collection Variable

  1. Create a Record Collection Variable varRMemberships type Group Member to store record variable (created in step 1.6.5) for the bulk process.
  2. Drag-and-drop the Assignment element onto the Flow designer. 
  3. Enter a name in the Label (Add Memberships into a List) field – the API Name will auto-populate.
  4. Set Variable Values
    1. Row 1:
      1. Field: {!varRMemberships}
      2. Operator: Add
      3. Value: {!varRMembership}
  5. Click Done.

Step 1.7: Salesforce Flow – Adding a Create Records Element to Add a New User to Public Groups and Queues

  1. Under Toolbox, select Element
  2. Drag-and-drop the Create Records element onto the Flow designer. 
  3. Enter a name in the Label (Add Membership (Queues and Public Groups)) field- the API Name will auto-populate.
  4. For How Many Records to Create select Multiple.
  5. Map Record Collection: {!varRMemberships}
  6. Click Done.

Step 1.8: Salesforce Flow – Adding a Create Records Element to Add Permission Sets to the New User

  1. Under Toolbox, select Element
  2. Drag-and-drop the Create Records element onto the Flow designer. 
  3. Enter a name in the Label (Add Permission Sets) field- the API Name will auto-populate.
  4. For How Many Records to Create select Multiple.
  5. Map Record Collection: {!varRPSAs}
  6. Click Done.


In the end, Steven’s Flow will look like the following screenshot:

Once everything looks good, perform the steps below: 

  1. Click Save.
  2. Enter Flow Label the API Name will auto-populate.
  3. Click Show Advanced.
  4. Type: Screen Flow
  5. API Version for Running the Flow: 51
  6. Interview Label: Clone a User {!$Flow.CurrentDateTime}
  7. 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. 

  1. Click Setup.
  2. In the Object Manager, type User.
  3. Select Buttons, and Links, then click New Button or Link.
  4. Input the following information:
    1. Display Type: Detail Page Link
    2. Select Add Follower to Record as Flow.
    3. Select Field type: /flow/rakeshistomMVP/Clone_a_User?recordId={!User.Id}
  5. 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. 

  1. Now click on the Clone This User Link.
  2. 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.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

55 thoughts on “Clone a User with their associated Public Group, Queue Membership and Permission Sets

  1. 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.

  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

    Error Occurred:
    The flow failed to access the value for AddIDs.PermissionSet.IsOwnedByProfile because the field is not available to the running user.

  3. 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.

  4. 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

  5. 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?

  6. 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!

  7. 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

  8. 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?

    1. 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.

  9. 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.

      1. 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.

  10. 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?

      1. 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.

  11. 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

      1. 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.

        1. 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.

  12. Is it possible to clone attachments using Flow?
    For instance, attachments on the opportunity (like a proposal) to a custom object?

  13. 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.

  14. 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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.