Initiating Actions from Reports

Last Updated on Thursday, 27 April 2006 08:05 Written by Steve Wednesday, 26 April 2006 01:33

Reports in Salesforce.com are great because you can query Contacts. And then you can drill down to a Contact’s record to do things like edit them, or add an Opportunity, etc.

But “drilling down” is really just a euphamism for “you have to click again.” And I think the goal of a web app is to remove as many clicks as possible. So I drive events from reports where it makes sense.

On this report, I can edit or delete any Opportunity that is listed. This is a pipeline report that shows all my CRM projects. I can easily move them from one stage to another without having to drill down.

This report is a list of Contacts. With one click I can start the process for adding each one to a Campaign. Again, no drill down. No extra clicks necessary.

I created two custom fields that can now be included on any Report or View that I have. Salesforce.com lets me add action links all over the place, which is freakin’ cool.

Edit Delete Link

In this example I created this field on the Opportunity object, but the same notation should work on any object.
Field Data Type: Formula
Field Label: Edit Delete
Formula Return Type: Text
Formula:
HYPERLINK("/" & {!Id} & "/e", "Edit") & " | " & HYPERLINK("/setup/own/deleteredirect.jsp?delID=" & {!Id}, "Del")

Add to Campaign Link

This only works on the Contact object
Field Data Type: Formula
Field Label: Add To Campaign
Formula Return Type: Text
Formula:
HYPERLINK("/00v/e?retURL=%2F" & {!Id} & "&parent_id=" & {!Id} , "Add to Campaign")

CRM is about looking up information, but it’s more importantly about action. Enable your users to act in as many places as possible.

Update: We had some earlier problems with copying and pasting the hyperlink fields causing syntax errors in Salesforce.com. Kingsley pointed me to the fix, and all is well now. If you ever want to post formula fields on the web, wrap them in CODE tags!

Comments


58 Comments

  1. Kingsley   |  Wednesday, 26 April 2006 at 2:41 pm

    Very slick!

  2. Steve   |  Wednesday, 26 April 2006 at 2:48 pm

    Thanks, Kingsley!

  3. Eugene Chan   |  Wednesday, 26 April 2006 at 2:49 pm

    Been subscribed to your weblog for a while. Really good information including this post. Keep it up.

  4. Steve   |  Wednesday, 26 April 2006 at 2:50 pm

    Thanks Eugene. Nice to hear you dig it!

  5. Scott   |  Wednesday, 26 April 2006 at 3:05 pm

    This is a very cool idea and totally agree about allowing action from multiple perspectives. Nice work.

  6. AJ   |  Wednesday, 26 April 2006 at 3:07 pm

    Very cool…but kept getting a syntax error when trying to add the field…I did a copy and paste…guessing I am missing something. Please help.

  7. Gareth   |  Wednesday, 26 April 2006 at 3:11 pm

    Nice work, well done!

  8. Steve   |  Wednesday, 26 April 2006 at 3:14 pm

    AJ: copying and pasting sometimes inserts spaces that cause syntax errors. Remove extraneous spaces and it should be OK.

  9. Kingsley 2.0   |  Wednesday, 26 April 2006 at 3:24 pm

    List of Salesforce.com bloggers

  10. AJ   |  Wednesday, 26 April 2006 at 3:38 pm

    Thanks Steve that did the trick!

  11. Steve   |  Wednesday, 26 April 2006 at 3:41 pm

    Great AJ!

  12. Successforce Blog   |  Wednesday, 26 April 2006 at 4:14 pm

    Edit and Delete Records Directly from a Report with Custom Buttons

    Today on the message boards gokubi posted a great best practice idea for initiating actions directly from a report. The way Salesforce’s reporting tool works is that you click through to view the record but it’s one more click if

  13. Brooks Jordan   |  Wednesday, 26 April 2006 at 5:32 pm

    Simplicity will set us free, right? Thanks for these Steve.

  14. SalesForceWatch.com   |  Wednesday, 26 April 2006 at 5:59 pm

    One Less Click

    Steve has posted an excellent write-up on using forumula fields on reports and views to let users take action directly from those screens rather than drilling-down into the report/view. gokubi.com: Initiating Actions from Reports

  15. Steve   |  Wednesday, 26 April 2006 at 8:48 pm

    Thanks Brooks! The folks at Salesforce make these great innovations, and it’s wild how we all slowly discover ways to wield them. I’ve been having a blast lately. I’ve got a really interesting one up my sleeve that I think people will have fin with…just got to get through this project work!

  16. Chris   |  Wednesday, 26 April 2006 at 10:40 pm

    Steve, I initially ran into the same error I think AJ hit, but for a different reason – for some reason it didn’t like my copy/paste and I had to manually type the formally in (literally replacing a pasted quote with a manually-typed quote, etc.). The formulas now function well, and it’s a great hack – however it does open the link in a new window. Anyone else experiencing this or have a tip to push it back within the same window/tab the initial report was in? Thanks!

  17. Keith   |  Thursday, 27 April 2006 at 5:59 am

    This is brilliantly simple! Thanks for sharing.

  18. Steve   |  Thursday, 27 April 2006 at 6:09 am

    Thanks Keith. The real brilliance is in the way sf.com has developed their web app. They’ve made so many of the applicaiton action links discoverable and recreatable dynamically via hyperlink formula fields. I’ve used plenty of webapps that don’t do that well.

  19. Steve   |  Thursday, 27 April 2006 at 6:13 am

    Chris: hyperlink fields open a new window by default. I use Firefox and tell the browser the whenver a link tries to open a new window, force it to open a new tab instead.

  20. John Nail   |  Thursday, 27 April 2006 at 7:53 am

    Great ideas!!!

    The link as shown below does get past the validation (the spaces seem to have been the problem)but I get this error message:

    “Unable to access page.
    Information needed by the page you have attempted to access is incorrect. If you believe this is an error, please refresh your screen. If the error persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information.

    Click here to return to the previous page.”

    HYPERLINK(“/00v/e?retURL=%2F” &”parent_id=”,”Add to Campaign”)

  21. Steve   |  Thursday, 27 April 2006 at 8:46 am

    Looks like your HYPERLINK lacks the dynamic insertion of the Id, which is what makes this technique work. {!Id} is the notation that goes out and gets the current object’s Id. Hope that helps!

  22. Chris   |  Thursday, 27 April 2006 at 10:53 am

    Thanks for the reply, Steve – while I love the hack, it would be great to continue having my Salesforce.com operating within one tab, instead of popping open a new one. You know how you can choose the window properties for Custom Links within Accounts, etc.? Something like that (“Open in Salesforce window without sidebar”)…

  23. Steve   |  Thursday, 27 April 2006 at 12:48 pm

    Sorry, HYPERLINK fields always open in a new window–that’s the way Salesforce.com has built them, and they don’t let you make them behave differently. I personally love working in multiple tabs of a browser, especially in Firefox. Try it, I think you’ll like it!

  24. Kingsley   |  Thursday, 27 April 2006 at 2:45 pm

    Steve, you may want to stick the formula inside a code or pre tag.

  25. Steve   |  Thursday, 27 April 2006 at 3:09 pm

    Thanks for the tip Kingsley. CODE tag did the trick. Copy and paste no longer causes syntax error in formula.

  26. Schlink   |  Thursday, 27 April 2006 at 5:28 pm

    Great ideas!

  27. Steve   |  Thursday, 27 April 2006 at 8:03 pm

    Thanks Schlink!

  28. Tomasz   |  Friday, 28 April 2006 at 2:59 pm

    We use SFDC primarily for Support and Services.
    I just added this trick to majority of our “Support” reports. It’s an awesome time saver.
    Thanks!

  29. Steve   |  Friday, 28 April 2006 at 3:58 pm

    Cool Tomasz. Glad you find it helpful! You could probably create a “close case” link as well, if that would make sense.

  30. Tomasz   |  Saturday, 29 April 2006 at 12:56 am

    Hi Steve, Funny enough I’ve already done it using “/s” parameter. I am still trying to figure out if it’s possible to pass/change field values via URL. Example change Status field value from “New” to “In Progress”. We have done it with Java Script (and Custom Links), however URL will be very neat.

    Also, there is a “half” solution for Chris question about HYPERLINK and a new window. Firefox allows you to force new links to open in a new tab (Preferences | Tabs). It works well with SFDC function too.

  31. Kingsley   |  Saturday, 29 April 2006 at 2:33 am

    You’re welcome.

    Tomasz: We’ve been recommending variations of the new window/tab method for a while. In Firefox, you can also drag and drop a link on the tab bar (or a specific tab) to open it.

    I’m curious about the /s parameter though – care to share more?

  32. Tomasz   |  Saturday, 29 April 2006 at 2:48 am

    Hi Steve,
    I cracked it. It was easy to change custom field values as their IDs as visible via URL. I followed your “conversation” with Ron Hess and I was able to snoop on “Status” field via View Page Info | Form | editPage label.

    He is the custom link which clones a case, links it back to the original case (via a custom field 00N20000000mmrC) and changes “Status” field (cas7) to “In Progress”

    https://emea.salesforce.com/{!Case_ID}/e?&clone=1&cas7=In%20Progress&00N20000000mmrC=https://emea.salesforce.com/{!Case_ID}

    And yes, I used it too to pass ad hoc parameters to a standard reports.
    I think Ron Hess’s tip deserves a medal!

  33. Steve   |  Saturday, 29 April 2006 at 11:48 am

    Ron’s a super star! Nice work Tomasz, I like what you’ve done. I’ll have to go back to that conversation with Ron and refresh a bit. It helped me with Campaigns, but I’ll have to look into other objects as well. The way I generally work is use an S-Control to create an object and then pop it up in Edit mode. this way is really interesting…

  34. Jeff   |  Monday, 01 May 2006 at 6:42 am

    Awesome! thanks for the post.

  35. Gary   |  Wednesday, 03 May 2006 at 1:45 am

    Excellent bit of functionality. One thing just to be careful about is that if the report has a lot of columns then the Edit / Delete buttons appear one above the other – and very close to each other. This means its easy to unitentionally click Delete, in which case the record is deleted without warning.

    I’ve actually removed the Delete from both the field label and the formula to prevent this happening. I don’t think its a big loss from a user perspective as most of the time they want to update rather than delete opportunities (arguably opportunities should never be deleted, just closed).

  36. Ian   |  Tuesday, 16 May 2006 at 11:43 am

    Can this be taken one-step further where the action changes a custom field value and then saves and closes the pop-up window? That way the report acts more like an editable worksheet. We are looking for a simple way for users to add/remove a contact from a specific mailing list.

  37. Steve   |  Tuesday, 16 May 2006 at 7:38 pm

    Sure, you would just have to write the S-Control that would do the action you require. Then create a formula field that calls the S-Control and put that link on your report/view.

  38. kkkkoaaa   |  Saturday, 27 May 2006 at 2:11 am

    Keep a good job up!

  39. Jane   |  Tuesday, 25 July 2006 at 5:34 am

    Thanks so much for this neat little trick! I created two – one with the Delete part and one without, like Gary suggested. Keep up the great stuff and thanks for sharing.

  40. Brian   |  Wednesday, 16 August 2006 at 12:42 pm

    Sorry, Figured out the redirect issue

  41. petyr   |  Wednesday, 23 August 2006 at 3:03 pm

    First, great Tool.

    Second, to Gary’s point. This there any way to include in the formula a pop-up box that would warn the end user they are about to delete data? This would be the icing on the cake to an already cool functionality.

    If it has to be done via an s-control, any idea how that would work?
    Thanks,
    p

  42. Steve   |  Wednesday, 23 August 2006 at 4:09 pm

    An actual delete link on a regular sf.com page looks like this:

    onclick="if (window.confirm('Are you sure?')) window.location='/setup/own/deleteredirect.jsp?retURL=%2F003%2Fo&delID=0034000000Kysil'"
    

    I haven’t tried this, but you might be able to insert the js popup as in this example…

    Good point!

  43. Paul   |  Friday, 29 September 2006 at 4:33 am

    The sf user community is salesforce.com’s greatest asset. Your tips were very helpful and I put them to use immediately.

    Thanx,
    Paul

  44. Steve   |  Friday, 29 September 2006 at 8:00 am

    Glad you found the post helpful! I agree, users are a great source of tips and cool ideas.

  45. Jeremy   |  Friday, 26 January 2007 at 2:11 pm

    Nice work on this one! – I’ve got it up and running. I’m trying to create the same but the URL I actually want to go to when I click the link is the next step, to assign the member status.

    How would I do this?

  46. Steve   |  Friday, 26 January 2007 at 4:46 pm

    If you set up the Add to Campaign button like it’s shown above, it should drop you on the choose member status page.

  47. Andy   |  Tuesday, 30 January 2007 at 1:11 pm

    I think this is great. However, I have a slightly different question. We’re trying to manage everything from within the Tasks.

    Is there a way to use the above to allow a user to update Member Status from within a Task? They want to avoid any extra mouse clicks, such as going to the Contact/Lead record and clicking Edit on the Campaign listed in their Campaign History.

    Thank you

  48. Steve   |  Tuesday, 30 January 2007 at 1:16 pm

    Yes you could. Just create a formula field on Activities and use the WhoId field, which will be either the Contact Id or the Lead Id of the person the Activity is related to. The link you create will only show on the detail page of the task. To get all Winter ’07 on it, you could create a button on the Task that calls the URL. Then each Task would have Edit | Delete | Add Contact to Campaign as buttons across the top. Check out the Winter 07 documentation to try that out.

  49. Ksenya   |  Tuesday, 26 February 2008 at 3:21 pm

    This is really awesome, thanks for the tip!

  50. Brendan Lally   |  Wednesday, 10 September 2008 at 1:34 pm

    I am creating an example the same as yours on a custom object.
    I am creating a custom field, type text, size=250 and then using
    HYPERLINK(“anywhere” , “Do stuff”)

    I am getting Error: Function HYPERLINK may not be used in this type of formula

    any ideas?
    in developer edition

    Lal

  51. Brendan Lally   |  Wednesday, 10 September 2008 at 3:05 pm

    Duh! I had set it up as New field, Text, formula, Hyperlink
    needed 2b New Field, Formula, Text, Hyperlink

    Lal

  52. Kiran   |  Friday, 11 September 2009 at 3:36 am

    it works really good..thanks

  53. TJ   |  Tuesday, 22 September 2009 at 7:07 pm

    Is there a way to add a validation box to the delete function? For example, when you click most delete links or buttons in SF, you’ll be prompted with a box asking you if you’re sure you want to delete the record. This formula is awesome, but I’m worried that the delete button will be clicked on accident when someone goes to click edit, and the record will be deleted.

  54. Make your Salesforce Reports Actionable « Echo Lane   |  Thursday, 29 April 2010 at 9:29 am

    [...] tip from GoKubi, is an oldie, but [...]

  55. PAUL   |  Monday, 23 August 2010 at 12:45 am

    I saw a post from steve that started to map some of the key non-profit business processes and noted at end this was to be continued. I have searched and not found any more… anyone know if there are more and if so where they are… thanks

  56. Steve   |  Monday, 23 August 2010 at 6:59 am

    I’m not sure which post you mean. I think the donor management processes are the only ones I mapped out. http://gokubi.com/archives/what-ive-learned-about-donor-management

  57. PAUL   |  Monday, 23 August 2010 at 12:32 pm

    Sreve, thanks for reply…. I was recently pointed to the post where you mapped the donor process and in that post you mentioned this was the first of several posts in which you were going to map the common non profit processes… from what you say these were the only ones mapped/posted.

  58. Steve   |  Monday, 23 August 2010 at 12:34 pm

    This became a series of posts, and these are the only processes I mapped in detail.

Leave a Reply