Search This Blog

Tuesday, June 25, 2013

Setting Salesforce Users' Passwords with Workbench

One request that I'm sure many admins get is "Can you set my password to {insert pet's name here}?". For a long time, the standard answer was always "Unfortunately I can only reset your password". The ability to set a user's password was available, but for a lot of admins is required tools and skills that were more in the realm of the developer. Enter:

"Workbench is a powerful, web-based suite of tools designed for administrators and developers to interact with organizations via the APIs. Workbench includes robust support for the Partner, Bulk, Rest, Streaming, Metadata, and Apex APIs that allows users to describe, query, manipulate, and migrate both data and metadata in organizations directly in their web browser with a simple and intuitive user interface. Workbench also provides many advanced features for testing and troubleshooting the APIs, such as customizable SOAP headers, debug logs for API traffic, backward compatibility testing with previous API versions, and single sign-on integration within the Salesforce application."

With access to Workbench, all admins now have the ability to set a user's password to a predetermined value. Keep in mind that just because you now have the ability to do this, it doesn't necessarily mean that it's permitted by your company's security/compliance policy. Nonetheless, that's a different discussion for another time. For this post, we'll focus on the "Can" and the "How", not the "Shouldn't".

The process is very simple. Go to the Workbench site at and login using your SFDC credentials.

Click on the Utilities menu option and select Password Management.

Enter the user id of the user account you want to set the password for. Then enter and confirm the new password. Click the "Change Password" button and you're set.

Workbench is a great tool and should be part of every admin's toolbelt. Explore all the features and see all the useful things it can help you do. Read more about Workbench here: Developerforce Workbench

Friday, November 18, 2011

Custom "Login as Owner" button

As an admin of an org with ~100 records types and countless page layouts, I often have to login as a specific user to troubleshoot something he/she is not seeing. Most of these troubleshooting sessions would be with the record owner on the phone where he/she would give me an account number or a booking number and we'd go look at the record. Having to go to Setup | Manage Users | Users.... or search for the user then go to the user detail and click on Login was getting old. This lead me to create a custom button that I placed on the Admin page layout for objects such as Accounts and Opportunities. This is useful for me because our admins have a specific page layout for each object that contains a lot of audit fields that we do not want to include in the other layouts. Now when a user contacts us, we can simply navigate to the record in question and click on the "Login as Owner" button and viola! We are now logged in as the owner seeing the specific record being discussed in their assigned layout. No searching, not traversing the Setup menu.

Here's the code for the button. This code is for the Lead object. Customizing it for other objects is cake. Just set the targetURL to match the appropriate object Id. In the Lead example below, it's set to "{!Lead.Id}"

Click on Setup | Customize | Leads (adjust this accordingly) | Buttons and Links | New
Label: Login as Owner
Name: Autofilled (Login_as_Owner)
Display Type: Detail page Button
Behavior: Display in New Window
Content Source: URL

Link Code:

Tuesday, October 25, 2011

Custom Lead Convert button...more URL hacking

Although the practice of URL hacking is not officially supported by, it comes in handy. The concepts you will learn here apply to a lot of other areas in where you can pass parameters in the URL. Today we will focus on the lead "Convert" button.

There are instances where we need to pass specific settings/values to the Lead Conversion page. For example, we may want to check off the "Do not create a new opportunity upon conversion." checkbox by default when a user clicks on the Convert button. Let's get to it.

1. Step one is to create a custom button to replace the standard "Convert" button. Click on:
Setup | Customize | Leads | Buttons and Links | New

2. Enter the required information. See image below

3. Enter the following code in the formula field:
window.location.href="/lead/leadconvert.jsp?nooppti=1&sem=1&tsk5_fu='Contact New Lead: {!Lead.LastName}&tsk4_fu={!Today()+3}&tsk13_fu=High&tsk12_fu=In Progress&id={!Lead.Id}&RetURL=/{!Lead.Id}";

The custom Convert button now does the following:

- Checks off the "Do not create a new opportunity upon conversion." (nooppti=1)
- Passes the Task Subject value for the task (tsk5_fu)
- Passes the Task Due Date of the Task (tsk4_fu={!Today()+3})
- Passes the Task Priority value (tsk13_fu=High)
- Passes the Task Status value (tsk12_fu=In Progress)

Here are all of the page elements (fields) and their respective id's:

- Send Email to Owner: sem
- Opportunity Name: noopptt
- Converted Status: cstatus
- Priority: tsk13_fu
- Status: tsk12_fu
- Comments: tsk6_fu
- Send email notification: email_followup
- Reminder: IsReminderSet_fu
- Reminder Date: reminder_dt_fu
- Reminder Time reminder_dt_fu_time

Don't forget to add your new button to your desired page layout(s). Enjoy.

Wednesday, August 24, 2011

Passing Report Criteria via Dynamic Links

I know, this is nothing new. There are countless of blogs out there with information on how to pass report criteria in custom links, but as I looked around last night I realized that the information is somewhat scattered. I just want to try and bring it all together with a list of input prefixes and operators.  Hopefully this will be a useful resource for others. This is by no means a step-by-step post.

The whole concept of passing report criteria in a custom link boils down to URL hacking. does not officially support this practice, but I find it very useful and leverage it every chance I get. For the experienced guru, you probably already know all of this stuff, and you probably stopped reading after the title. For everyone else, here we go.

Below is a screenshot of a report criteria. There are three fields in the criteria that you will need to pass data to in order to  fully control the criteria.

pc0: Corresponds to the field in the report criteria.
pn0: Corresponds to the operator in the report criteria.
pv0: Corresponds to the value in the report criteria.

These inputs are 0 based that means that you will access the first set of filter fields using 0 (e.g. pc0, pn0, pv0). As you add more filters, you just increase the number (pc0, pc1, pc2...).

Now to the operators. Here are the values that Salesforce is expecting:

eq = equals
ne = not equals
lt = less than
le = less than or equals
gt = greater than
ge = greater than or equals
co = contains
nc = does not contain
sw = starts with
in = includes

Bringing it all together. Run the desired report and copy the report ID from the URL. We'll use our Won Opportunities report for this example ( Paste the report id into the link window. You can then append filter parameters at your leisure.


In the example above we are passing the Account ID in dynamically based on the record the user is in when he/she clicks on the link. Keep in mind that you can use the methods we have covered here to override filter criteria for existing report allowing you to reuse them when necessary instead of having to create a report with predefined filters where you only pass the filter value (pv). There are things you will need to tweak here and there. For example when passing currencies in your pv parameter you will want to URLENCODE() to make sure that value gets passed correctly.

You can also leverage Visual Force pages that include these links to make it a little more snazzy, adding descriptions and images to your link. We'll leave that for another day. Today's post is just scratching the surface on the subject.

Thursday, July 28, 2011

Custom Round Robin Lead Assignment

Have you ever needed to implement round robin lead assignment in If you have, then you are familiar with the suggested approach of using assignment rule entries and a couple of custom fields. Although it works, it becomes a pain to manage once the number of members in the round robin start to climb. Other approaches would use custom Apex triggers. I'm not developer, but I'm brave enough to mess with existing apex and this is where a fantastic little free app from the AppExchange comes in.

Currently my favorite approach leverages the Round Robin Record Assignment  app from Force Labs available on the AppExchange. The app is configured to manage the assignment of cases, but with a little tweaking of the triggers and the class, you can get it to manage leads as well.We added a couple of custom fields and work flows and VIOLA!!! You have your custom Round Robin Lead Assignment application that you can also manage from from your iPhone or Blackberry (and you know Android is coming next month).

The app, as we have customized it, allows us to add members (users) to the assignment group with a couple of clicks and removed them by simply setting their Active status in the Assignment Group to "false". You can also schedule the removal and re-insertion of members from and into the round robin cycle. This is useful when a rep is going on vacation. All you have to do is enter the date that he/she will be leaving and the date of their return. The work flows will take care of changing their active status in the assignment group to false and back to true on their scheduled return date.

Before if you wanted to individually assign leads to 20 reps using round robin, segmenting them as Hot and Warm, you would have to create 1 assignment rule entry per user per queue (Hot and Warm queue). That's 40. With this app, you can now do this with 2 rule entries and let the Assignment Group membership handle the actual assignment.Thank you Force Labs.

Here's a link to the setup and configuration of the app.
Round Robin Record Assignment - Setup and Configuration.

Below I have included a screenshot of the Assignment Group screen. You can see the number of users (20) in the group. and you can see what Queues are associated with the group. In this case there is only one. By looking at the Assignment Group Members related list, you can see the members and their statuses, the last  assignment made in the group to the member, as well as any scheduled dales for exiting and re-entering the assignment group.

Tuesday, July 26, 2011

Leveraging the power of real world example.

Before I left for DF'10 last year, I had one of the directors approach me with the high level requirements for an application. We were evaluating other off-the-shelf solutions and he wanted me to see if JIRA, our open source issue management system, could be customized to handle the requirements. I looked over the requirements and said "Why don't we do this in Salesforce?" The reply was what I expected, "Give me a proof of concept with estimates on licensing and development effort."

That week I flew out to San Francisco, after having missed the previous Dreamforce. While I was there I was blown away by the energy. Non-Salesforce people ("Muggles", looking from the outside in, would probably call it "cult-like". The excitement was palpable. I attended as many sessions as I could. I interacted with others like me. I walked the expo floor and looked at countless products and services. I was floored and needless to say, inspired. On the flight back I logged into one of my sandboxes and got to work on the app (yes...I had internet...gotta love Virgin). In about 2 hours or so I had the app built. Three custom objects, 6 workflows, 1 approval process 10 reports and one dashboard. I had the new branch to our role hierarchy all set, profiles, etc... The app was slick and simple. I couldn't wait to demo it on Monday.

On Monday, the demo went down without a hitch. They were thoroughly impressed. You can write up all  the business  cases you want to justify something like this. Talk about ROI, TCO, TTM, etc...  but nothing beats an app you can get your hands on. The bottom line is this. We leveraged the platform and 3 hours of my time on a plane to deliver a solution at a cost savings of almost $40k a year. A cloud app that did not require our users in Europe to VPN in, with built-in sharing mechanisms, security, reporting and mobility. Name me another platform where I can go from high level requirements to "full tilt boogie" (to quote my good friend Carlos....former Marine Force Recon) in 3 hours? Not many.

The app has been in production  since that day. No bugs, no hic-ups, nothing, nada....which speaks more to the stability of the platform than my design/implementation skills. Like I said...a simple app that paid for itself countless times. That's how I leverage DF'10! Let's see what happens this year.  Don't pass up the chance to get involved. If you can't attend, view the recorded session. Join the countless community boards and groups on LinkedIn. This is your chance to harness our energy.

Thursday, July 14, 2011

Custom Fields Gone Wild...

Have you ever stepped back and looked at all the custom fields that exist in your org? If your org is anything like my current org and the org of most of my past clients, that number can be daunting. One of the major hurdles in managing all of these custom fields is getting a grasp on their usage. On a quarterly basis I run some data quality analysis on 5 of my biggest objects in terms of fields. I use a custom app called The Inspector which I listed in My Toolbelt post. The app is very easy to use and it allows you to create custom reports against its "Object Statistics" records which are the field analysis runs that you can perform against your objects. Here's a screenshot of one of mine.

In this screenshot, you can see that there are only 479 records with data in the "911" custom field, which represents 0.4 of my total lead records in the org. How valuable is this field? This is the type of question that you can begin to ask your users. To get more detailed information, click on the ID for the record. In this case it's FS-250. You now have more granular information about this field and its usage.

You can now see when the field was first used, when it was last used and the number of days since it was last used. This is the kind of information that will allow you to build a case for deprecating a field.

I know it seems like a lot of work, but sometimes you need to get down in the weeds to make sure that you keep your org clean. This very valuable information for a system admin. In this post I have given you a small glimpse on one of the ways you can start tackling your "custom fields gone wild". Hopefully this has given you a good starting point to begin your clean up. Keep in mind that this is an ongoing process. This is not a "one and done". Good luck.