Rakesh Gupta’s Salesforce Newsletter of the Week – 27th July 2014

Posted on Updated on

Articles that you may like

1) Clone Public group or Queue with members
2) Embedding Charts Anywhere
3) Using Topics to Organize Records
4) Requesting a Meeting Using Cloud Scheduler

Tip #1 – Filter Debug Logs

Salesforce allows you to debug your code by using the Developer Console or monitoring a debug log. In debug log Salesforce is tracking the number of information’s. Debug logs filtering provides a contrivance for refinement the log prolixity at the different Category level like a trigger, class, Visualforce page,workflow level etc. This is very helpful when debugging Apex logic, workflow rule or something else . To filter the debug log follow the below instruction

1) Click on Name | Setup | Administration Setup | Monitoring | Debug Logs
2) Click on Filters link, as shown in the below screenshot

Filter Debug Logs
Filter Debug Logs

3) Now you can select the log level  for each for each Category and Salesforce set events accordingly, as shown in the below screenshot

Filter Debug Logs for Different Category
Filter Debug Logs for Different Category

Tip #2 – Salesforce app for Blackberry mobile

Frequently I found question people are asking how to access Salesforce on Blackberry mobile. If you are using Blackberry mobile and it’s not running on the BlackBerry 10 platform  then you can use Salesforce Classic or Chatter mobile app to access Salesforce, but remember after Summer’14 release Salesforce stop supporting of these app it means you can still use these app until  they are officially deprecated but Salesforce is no longer providing support in the form of bug fixes or enhancements for any Mobile Access issues.

Connect to Salesforce
Connect to Salesforce

If you are using Blackberry z10 mobile with  BlackBerry OS 10.2 or later then you can use either Mobile browser or  Connect to Salesforce app to access Salesforce on your mobile.

Join the cloud computing community at an event& webinar near you

Salesforce.com events and webinars are a great way to meet and learn from other Salesforce enthusiasts. Want to know about the Salesforce upcoming event and webinar then browse below url

Event:- http://goo.gl/SdMUOi
Webinar:- http://goo.gl/7fy2Hu
Below are the list of few upcoming events and webinars

1) Become a Hero of Mobile: Salesforce1 Mobile App Best Practices
2) Force.com Friday: Intro to Force.com
3) Force.com Friday: Intro to Apex

Salesforce Summer’14 release exam

To maintain Salesforce certification credentials, all Salesforce certified professionals must successfully complete three online, release-specific exams every year. Release exams are published in conjunction with major product releases (Winter, Spring, and Summer).  Summer’14 Administrator and Developer release exam is available now.

Rakesh Gupta’s Salesforce Newsletter of the Week – 20th July 2014

Posted on Updated on

Articles that you may like

1) Auto Follow and Auto Unfollow records based on Criteria – Part 1
2) Automatically add Permission Sets to new User
3) Auto Follow and Auto Unfollow records based on Criteria – Part 2
4) Clone Public group or Queue with members

Tip #1 – Compare fields to each other in Report

Salesforce doesn’t allow us to Compare fields in the Report. Here is the existing idea at IdeaExchange http://goo.gl/IQ0dZR. But there is a workaround for this problem. in this demo I will compare Owner of Opportunity and Account, If the owner is matched formula will return 1 else 0. for more details follow the below instructions

1) Click on Name | Setup | App Setup | Customize | Opportunities | Fields
2) Create one Custom formula field (Number Type) as shown in the below screenshot

Custom Formula Field
Custom Formula Field

3) Click on Save.
4) Now create one report on Opportunity object and use this field, as shown in the below screenshot

Compare fields in report
Compare fields in report

Tip #2 – Attachment size in Outbound email

The size of the attachment in Outbound email is 10MB. To make sure about this go to Contact record and navigate to Activity History related list and click on Send an Email button as shown in the below screenshot

Send a Email button
Send an Email button

It will redirect you to a new window from where you can Send an Email to your customer, now try to add an Attachment and you will find details about attachment size limitation

Outbound Email Attachment size
Outbound Email Attachment size

Join the cloud computing community at an event& webinar near you

Salesforce.com events and webinars are a great way to meet and learn from other Salesforce enthusiasts. Want to know about the Salesforce upcoming event and webinar then browse below url

Event:- http://goo.gl/SdMUOi
Webinar:- http://goo.gl/7fy2Hu
Below are the list of few upcoming events and webinars

1) Learn to Hack It: Top 5 Salesforce Hacks
2) Force.com Friday: Intro to Visualforce
3)

Remember to pass your Salesforce Winter’14 release exam

To maintain Salesforce certification credentials, all Salesforce certified professionals must successfully complete three online, release-specific exams every year. Release exams are published in conjunction with major product releases (Winter, Spring, and Summer).  Summer’14 Administrator and Developer release exam will available from 21st July 2014.

Clone Public group or Queue with members

Posted on Updated on

Clone

After Clone Chatter group with members article I got lot’s of Emails/Messages from people wants to know about how they can clone “Public Group or Queue. Before going ahead I want to say big thanks to Mr. Mark Ross to featured my #Sp14FlowHackathon idea in his article.  In this article I will discuss how a Salesforce Admin can build an application using Flow to Clone Public Group or Queue.

Business Use case :-  As a Salesforce admin many times you got the requirement to create one Public Group similar to existing group X (In our case we will say Public Group Sales Managers) and add few more users into it.

Solution of above business requirement

Again this is 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.  A Group 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.

Note:- In this article I will only discuss about clone Public group . In similar fashion you can develop a flow for the Queue.

To develop this application follow the below instructions

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 Clone Public Group) on the window,add Three fields with below details

Name Data Type Required
Old Group ID Textbox Yes
Textbox Textbox Yes
Grant Access Using Hierarchies Checkbox No

It will look like the below screenshot

To Get User Input
To Get User Input

4) Drag and drop a Record Create ( Give the name Create Public Group) onto the window to create a new Public group and map the fields according to below details

  • Select Object Group
  • Name=  {!New_Group_Name}  [ This is nothing but Screen Input]
  • Type=Regular
  • DoesIncludeBosses={!Grant_Access_Using_Hierarchies} [ This is nothing but Screen Input] , Save Id of record into any variable in our case it’s {!NewGroupId}. You can take help from the following screenshot
Create new Public group
Create new Public group

Note:- For Queue set Type = Queue and remove the field DoesIncludeBosses from Record Create element and add another field as per your choice.

5) The next task is to get the list of the member id from the old Public Group for cloning. To do this Drag and drop a Fast  Lookup( Give the name Extract all members from old group) and map the field according to the below screenshot and save the field UserOrGroupId value into Sobject Collection in our case it’s {!OldMembersID}

To get the list of members from selected group
To get the list of members from selected group

6) Now our next task is adding members in the new group. For this we will use Loop, Assignment and Fast Create. To do this Drag and drop a Loop ( Give the name Extract memebrs one by one) and loop through Sobject Collection {!OldMembersID} and save current value in New Sobject Varibale {!OneByone}  as shown in the following screenshot

Loop through Sobject Collection
Loop through Sobject Collection

7) Now Drag and drop an Assignment Logic ( Give the name Assign New Group ID) and assign {!NewGroupId} to Sobject Varibale {!OneByone.GroupId}, as shown in the below screenshot

Assign New Group ID
Assign New Group ID

8) Drag and Drop Assignment Logic (Give the name Mass Add) on the window and assign value from Sobject variable {!OneByone} to Sobject Collection variable {!AllinOne} so at the end of for loop (To avoid SOQL limit) it will add all members from old Public group to new Public Group. Take the help from the below screenshot

All in One
All in One

9) Finally drag and Drop Fast Create (Give the name Add Members In New Group) on the window and map the field according to the below screenshot

Add Members into New Public group
Add Members into New Public group

Finally our Flow will look like the following screenshot

Clone Public group or Queue with members

10) Save the flow with name Clone Public Group or Queue and close the canvas.

Add Visual workflow into the home page component

We can call Flow from custom button, link, sub-flow, Visualforce page , Apex start() or using Flow Trigger workflow action. Here we will call our flow from the homepage component. To do that follow below instruction

1) Create custom link from Name | Setup | App Setup | Customize | Home | Custom link

Custom link
Custom link

2) Add custom link in the Home page component
3) Add Home page component into the Home page layout

It’s time to test this feature

1) In this demo I will Clone Public GroupSales Managers“, as a first step copy the ID of Public Group “Sales Managers
2) To open this app click on “Clone Public Group” link available on the homepage, and fill the details you can take help from below screenshot

Clone Public Group with members
Clone Public Group with members

3) Click on Next button and you are done. Below is the proof of concept

New Public Group with members
New Public Group with members

I will suggest you to Implement this first on your developer org test it and then move it to Production.

Automatically add Permission Sets to new User

Posted on Updated on

Permission Sets

Salesforce allows you to add Permission Sets to User to extend user’s functional access without changing their profile. For example, if you want to grant Modify all access to Account objects to a set of users without changing their profile or create a new profile.

Business Use case :- Universal Container is using Two Factor Authentication, to grant two factor authentication permission to user they created a Permission Set. Now Higher management wants to auto assign this Permission Sets to the new User.

Solution of above business requirement

This is a basic use case to start with Headless  flow. To solve this requirement we will use Visual Workflow, Workflow rule to fire Flow Trigger. Before proceeding you have to understand PermissionSetAssignment objects in Salesforce.

PermissionSetAssignment :- This object represents an association between a User and a PermissionSet.

Field Name Details
AssigneeId ID of the user to assign the permission set.
PermissionSetId ID of the PermissionSet to assign to the user.

Now we will create a flow to add Permission Set (Two Factor Authentication) to the new user. To do that follow the below instructions

1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
2. Click on New Flow, it will open flow canvas for you. Create One Text type variable UserID (to pass the new user id through Workflow Rule Flow Trigger action) as shown in the below screenshot

Variable UserID
Variable UserID

3. To add Permission Set (Two Factor Authentication) to new users, drag and drop a Record Create ( Give the name Add Permission Set) onto the window and map the fields according to below details

  • Select Object PermissionSetAssignment
  • Enter criteria AssigneeId= {!UserID} and PermissionSetId= ID of Permission Set (Two Factor Authentication), as shown in the below screenshot
add Permission Sets to nAdd Permission Sets to new Userew User
Add Permission Sets to new User

4) Finally our flow will look like below screenshot

Automatically add Permission Sets to new User

5) Save the flow with name (Add Permission Sets To User)  and close the canvas.

Create Workflow rule to fire our Flow

Our next task is to create a workflow on User object on create event to Fire our Flow Trigger.. To create a workflow on the User object follow the below instructions

1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | New Rule
2) Select object User from the drop-down
3) Enter Name, for Evaluate the rule when a record is select Created, For Rule Criteria select is Active= True, as shown in the below screenshot 

Workflow Rule on User Creation
Workflow Rule on User Creation

4) Add one Immediate Workflow Actions i.e. New Flow Trigger and Select Flow and set Variable (UserID) value as show in the below screenshot

New Flow Trigger Action
New Flow Trigger Action

5) Save the workflow and activate it.

It’s time to test this feature

To test this application follow the below steps

1) Navigate to Name | Setup | Administration Setup | Manage Users | Users
2) Create a New User
3) Now navigate to Permission Set Assignment related list in the user detail page and check for Permission Set (Two Factor Authentication).

Automatically add Permission Sets to new User
Automatically add Permission Sets to new User