Automation Champion

Automating Salesforce One Click at a Time
Automation Champion
  • Home
  • About Me
    • Testimonials
    • Resources
  • Process Builder
  • Salesforce Flow
  • Pardot
  • Apex
  • Training Details
    • Salesforce Administrator
    • Salesforce Advanced Administrator
    • Platform App Builder
    • Lightning Flow
    • Pardot
    • Sales Cloud
    • Service Cloud
    • Community Cloud
    • Hands-on Excercises
  • My Books
  • Contact Me
  • Tag: SalesforceA

    • Mass Transfer Records Using Salesforce1 App

      Posted at 7:13 PM by Rakesh Gupta, on April 28, 2014

      In day today life Sales people switch their job frequently, so to manage their existing or closed deal or lead we have to transfer it to the new owner. Salesforce provides various ways to change Ownership of records from one user to another. But Salesforce doesn’t provide a way to transfer records Ownership using Salesforce1 app. In this article I will show you the way by using it you can develop your own tool for transfer Ownership and it will also work on Salesforce1 app.

      Business Use Case 

      Higher management at Universal Containers wants to develop an application for Salesforce1, from where they can completely transfer record ownership from one user to another user in the mass.

      Solution for the above business requirement

      Again this is power of Visual Workflow, we will create an app without using a single line of code. Salesforce provides various another tool that you can use for this purpose like Data Loader etc. Our app will completely transfer all records from old user to new user, you can add conditions as per your business requirements. To develop add functionality follow the below instructions

      Note: – In this article I will discuss only about mass transfer of records. In similar fashion you can develop an application for transfer single record. I will also provide Unmanaged package of my app so you can play it within your dev org.

      1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2. Click on New Flow, it will open flow canvas for you
      3. Drag and drop a Screen ( Give the name Mass Transfer Record) on the window, add three fields with below details

      Name Data Type Value Required
      Object Name Dropdown List Account
      Contact
      Opportunity
      Yes
      Old Owner Textbox Yes
      New Owner Textbox Yes

      It will look like below screenshot

      To Get User Input Screen – 1

      To Get User Input Screen – 1

      4. On the next Screen we will show the list of old users based on user input on the old user field on Screen-1. Now add one Dropdown List field ( Give the name Old User Name) create a new Dynamic Choice with below details

        • Select Object User
        • Enter criteria IsActive= {!$GlobalConstant.True} and Name = {!Old_Owner} (Screen1 Old Owner input field)
        • Save ID in some variable in my case it’s {!OldOwnerID}, same like below screenshot
      To get list of user for Old user name

      To get list of user for Old user name

      Repeat same process for New user input field and get all users. Now add one Dropdown List field ( Give the name New User Name) create a new Dynamic Choice with below details

        • Select Object User
        • Enter criteria IsActive= {!$GlobalConstant.True} and Name = {!New_Owner} (Screen1 Old Owner input field)
        • Save ID in some variable in my case it’s {!NewOwnerID}.

      Finally, Screen-2 will look like below screenshot

      To confirm User name Screen – 2

      To confirm User name Screen – 2

      5. On the next Screen-3, we will confirm the all details from the user. Do to that Drag and drop a Screen ( Give the name Confirmation) on the window, add one field Display type and add text as shown in the below screenshot

      To Confirm all details Screen – 3

      To Confirm all details Screen – 3

      6. Now it’s time to decide which object record user want to transfer. Based on User input for “Object Name”  field on Screen-1 we will select the object and transfer the records. To do that add one Decision element and it will auto redirect to respective Record update element as shown in below screenshot

      Decision Element to select Record Update element for respective screen

      Decision Element to select Record Update element for respective object

      7. The final step is to transfer records for those objects from old user to new user. To do that Drag and drop a Record Update element onto the window, and map the fields as per below screenshot

      Transfer account records from old to new user

      Transfer account records from old to new user

      Repeat same Record Update process for contact and Opportunity object. Finally, our flow will look like below screenshot

      Masst Transfer Record Flow

       

      Use this app on Salesforce1

      • To use this app on Salesforce1 , create a Visualforce Page, Select Available for Salesforce mobile apps check box and embed your Flow and crate a Visualforce Tabs to call it. Bel0w is the sample code for your reference
      <apex:page >
      <br/>
      <Center><Font size ="6" color ="orange">Mass Transfer Records</font></Center>
      <br/><br/>
      flow:interview name="Mass_Transfer_Records"/>
      </apex:page>
      

      Now navigate to Name | Setup | Administration Setup | Mobile Administration | Mobile Navigation

      • Add you Visualforce Tabs into selected pane, as shown in below screenshot
      Add Visualforce Tab into Mobile Navigation

      Add Visualforce Tab into Mobile Navigation

      It’s time to test this feature

      To test this app open your Salesforce1 and navigate to Apps and click on your Tab (Mass Transfer Records) it will open a Visualforce page for you. In this demo I will transfer all account records where the owner is old user (Rakesh Gupta) to the new user(EMEA Sales) and click on Next In our case Screen-1 will look like below screenshot

      Screen -1

      Screen -1

      On the Screen-2 it will show the list of user based on user input on Screen-1. Select the old user and new user from the Drop-down list and click on Next, It will look like below screenshot

      Screen - 2

      Screen – 2

      On the Screen-3 it will show all the details in same screen and ask for your confirmation, if you are happy click on Next, and it will transfer all record from old user to new user. It will look like below screenshot

      Screen - 3

      Screen – 3

      Install this app

      I am offering this app an Unmanaged package, you can install it from below URL

      https://login.salesforce.com/packaging/installPackage.apexp?p0=04t900000004yMA

      To install this app replace Login with your Salesforce instance name in my case this url will look like

      https://ap1.salesforce.com/packaging/installPackage.apexp?p0=04t900000004yMA

      If you have feedback, suggestions for posts or need more information about Salesforce online training program running by me. Say hello and leave and message to me!

      Posted in Salesforce Flow | 16 Comments | Tagged ADM 201, adm 201 certification, adm 201 salesforce, admin release exam, Advance flow, Cloud Flow Designer Workbook, Con 201, Create record through flow, Decision element, dev 401, DEV401, developer release exam, Dropdown List, dynamic choice, flow, Flow examples, Flow exmple, Flow on Salesforce1, headless flow, Install Unmanaged package, Mass transfer record, Mass transfer records, Mobile Navigation, New Flow, Ownership changes, Record Create, Record Delete, s1devweek, salesforce, salesforce certified developer exam, Salesforce maintenance exam, Salesforce newsletter, Salesforce release exam, Salesforce release exam dates, Salesforce release exams, Salesforce weekly newsletter, Salesforce1, Salesforce1 Developer Week, SalesforceA, Screen, Unmanaged package, Visual flow, Visual workflow, Visual workFlow examples, Visual Workflow Implementation Guide, Visualforce page, Visualforce Tabs
    • Add/Remove user into Public Group or Queue from Salesforce1 app

      Posted at 9:41 PM by Rakesh Gupta, on April 25, 2014

      In Salesforce Queue and Public Group represent a group of users. We can add any number of users to Queue or Public Group. There is no limitation on the number of members per Public Group. This is a daily job of Salesforce admin to Add/Remove users from a queue or public group. As you aware that Form Salesforce1 or SalesforceA app we can’t Add/Remove user from the Queue or Public Group. Now let’s start with a business requirement.

      Business Use Case

      Higher management at Universal Containers wants to develop an application for Salesforce1, from where they can easily Add/Remove user from the Queue or Public Group.

      Solution for the above business requirement

      Again this is a power of Visual Workflow, we will create an app without using a single line of code. Before proceeding you have to understand Group and GroupMember objects in Salesforce.

      1. Group: – This Group object represents Queue and Public Group both. Groups are sets of users.  They can contain individual users, other groups, the users in a particular role. By using Type field you can distinguish between Queue and Public Group. For Public Group (Use Type = Regular) and for Queue (Use Type = Queue).
      2. GroupMember: – Represents a User or Group that is a member of a public group.

      In our app user will first select, where they want to add/remove user Public Group or Queue then enter User Name in same screen. On the next they will get an option to select Public Group or Queue, User that matches the User Name entered in the previous screen and action they want to perform Add or Remove. To develop add functionality follow the below instructions

      Note: – In this article I will discuss only about add/remove user into Public Group. In similar fashion you can develop for queue. I will also provide Unmanaged package of my app so you can play it within your dev org.

      1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2. Click on New Flow, it will open flow canvas for you
      3. Drag and drop a Screen ( Give the name Select Public Group or Queue and User) on the window, add two fields with below details

      Name Data Type Value Required
      Select Public Group / Queue Dropdown List Public Group
      Queue
      Yes
      Enter User Name Textbox Yes

      It will look like below screenshot

      To Get User Input Screen - 1

      To Get User Input Screen – 1

      4. Based on User input for “Select Public Group / Queue” field we will redirect the user to a different screen.If he selected Public Group then he will redirect to a new screen where he can see all Public Group from his organization and in case he selected Queue then he will redirect to a new screen where he can see all Queue from his organization. To do that add one Decision element and redirect user to the respective screen as shown in below screenshot

      Decision Element to redirect user to respective screen

      Decision Element to redirect user to respective screen

      5. Drag and drop a Screen ( Give the name Select Public Group and User) on the window, Add one Dropdown List field ( Give the name Select Public Group) create a new Dynamic Choice with below details

        • Select Object Group
        • Enter criteria Name!= {!$GlobalConstant.EmptyString} and Type = Regular In case of Queue use Type = Queue
        • Save ID in some variable in my case it’s {!PublicGroupID}, same like below screenshot
      Public Group Dynamic Choice

      Public Group Dynamic Choice

      • Add Another Dropdown List field to show list of users based on User Name entered in the Screen1. create a new Dynamic Choice with below details
        • Select Object User
        • Enter criteria  isActive= True and Name!= {!Enter_User_Name} (Screen1 User Name input field)
        • Save ID in some variable in my case it’s {!UserIDPG}, same like below screenshot
      User Name Dynamic Choice

      User Name Dynamic Choice

      • Add Another Dropdown List field to show the available action i.e. Add or Remove, Same like below screen shot
      Add Drop-down action

      Add Drop-down action

      6. Now add one Decision element to decide whether users want to Add or Remove based on that it will preform the necessary action. We will use action field to define a decision. You can take help from below screen shot

      Add Decision to Decide Add or Remove From Public Group

      Add Decision to Decide Add or Remove From Public Group

      7. The final step is performing Add or Removal action, to do this it’s required only two ID one is GroupID or Queue ID another is UserID.

      • To Add user into Public Group Drag and drop a Record Create onto the window, and map the fields as per below screenshot
      Add User into Public Group

      Add User into Public Group

      • To Remove user into Public Group Drag and drop a Delete Create onto the window, and map the fields as per below screenshot
      Remove User From Public Group

      Remove User From Public Group

      Finally, our flow will look like below screenshot

      add-remove-user-into-public-group-queue

      Use this app on Salesforce1

      • To use this app on Salesforce1, create a Visualforce Page, Select Available for Salesforce mobile apps check box and embed your Flow and crate a Visualforce Tabs to call it. Bel0w is the sample code for your reference
      <apex:page >
      <br/>
      <Center><Font size ="6" color ="orange">Add User Into Public Group or Queue</font></Center>
      <br/><br/>
      <style type="text/css">
      .FlowText {
        color: crimson;
      }
      .FlowDropdown{
        color: limegreen;
      }
      </style>
      <flow:interview name="Public_Group_Queue"/>
      </apex:page>

       Now navigate to Name | Setup | Administration Setup | Mobile Administration | Mobile Navigation

      • Add you Visualforce Tabs into selected pane, as shown in below screenshot
      Add Visualforce Tab into Mobile Navigation

      Add Visualforce Tab into Mobile Navigation

      It’s time to test this feature

      To test this app open your Salesforce1 and navigate to Apps and click on your Tab it will open a Visualforce page for you. Where you have to choose, Queue or Public Group and enter User Name whom you want to add and click on Next, It will look like below screenshot

      Select Group or Queue and Enter User Name

      Select Group or Queue and Enter User Name

      In the next window, you have to select Public Group from the list (List will show all public groups from your organization), User and action you want to perform, click on Next to complete the process. Finally, It will look like below screenshot

      Select Public Group, User and Action

      Select Public Group, User and Action

      Install this app

      I am offering this app an Unmanaged package, you can install it from below URL

      https://login.salesforce.com/packaging/installPackage.apexp?p0=04t900000004yHE

      To install this app replace Login with your Salesforce instance name in my case this URL will look like

      https://ap1.salesforce.com/packaging/installPackage.apexp?p0=04t900000004yHE

      If you have feedback, suggestions for posts or need more information about Salesforce online training program running by me. Say hello and leave and message to me!

      Posted in Salesforce Flow | 12 Comments | Tagged Add user to public group, Add user to public group Salesforce1, Add user to queue, Add user to queue Salesforce1, Advance flow, Cloud Flow Designer Workbook, Create record through flow, Decision element, Dropdown List, dynamic choice, flow, Flow examples, Flow exmple, Flow on Salesforce1, group, GroupMember, headless flow, Install Unmanaged package, Mobile Navigation, New Flow, Public group, Queue, Record Create, Record Delete, Salesforce1, SalesforceA, Screen, Unmanaged package, Visual flow, Visual workflow, Visual workFlow examples, Visual Workflow Implementation Guide, Visualforce page, Visualforce Tabs
    ← Older posts
    • Search

    • Upcoming Trainings

      Salesforce Administrator Certification
      Salesforce Advanced Administrator Certification
      Salesforce Platform App Builder Certification
      Lightning Flow & Process Builder
      Advanced Lightning Flow
      Pardot Specialist & Consultant Certification
      Sales Cloud Consultant Certification
      Service Cloud Consultant Certification
      Community Cloud Consultant Certification
    • Sponsor #1

    • Sponsor #2

    • Sponsor #3

    • Sponsor #4

    • Order Now!

    • Buy My Book

    • Buy My Book

    • Recent Posts

      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Streamline Data Collection with Salesforce-Connected Forms
      • Getting Started with Salesforce Flow – Part 56 (Merge Chatter Topics with the Help of Salesforce Flow)
      • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
      • Getting Started with Salesforce Flow – Part 55 (Add or Remove Followers to a Record with the Help of Salesforce Flow)
    • Salesforce ID Converter Build on Lightning Flow

      Converting 15 digit ID to 18 digit Salesforce ID
    • Blog Archives

    • Categories

  • Information

    • About Me
    • Affiliate Disclaimer
    • Contact Me
    • Privacy Policy
  • Top Posts

    • Learning Flow
    • Getting Started with Salesforce Flow – Part 42 (Running a Flow in System Mode)
    • Salesforce Spring’21 Release Quick Summary
    • Learning Process Builder
    • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
    • Add Record to Multiple Chatter Groups - Parsing Multi-Select Picklist fields (Flow)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
    • Getting Started with Salesforce Flow – Part 35 (When to Use Before-Save vs After-Save Record-Triggered Flows)
    • Getting Started with Salesforce Flow – Part 44 (Auto Convert Marketing Qualified Leads)
  • Social Media

    • View Automationchampion’s profile on Facebook
    • View Automationchamp’s profile on Twitter
    • View Rakeshistom’s profile on GitHub