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!
Very slick!
Thanks, Kingsley!
Been subscribed to your weblog for a while. Really good information including this post. Keep it up.
Thanks Eugene. Nice to hear you dig it!
This is a very cool idea and totally agree about allowing action from multiple perspectives. Nice work.
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.
Nice work, well done!
AJ: copying and pasting sometimes inserts spaces that cause syntax errors. Remove extraneous spaces and it should be OK.
List of Salesforce.com bloggers
Thanks Steve that did the trick!
Great AJ!
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
Simplicity will set us free, right? Thanks for these Steve.
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
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!
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!
This is brilliantly simple! Thanks for sharing.
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.
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.
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”)
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!
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”)…
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!
Steve, you may want to stick the formula inside a code or pre tag.
Thanks for the tip Kingsley. CODE tag did the trick. Copy and paste no longer causes syntax error in formula.
Great ideas!
Thanks Schlink!
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!
Cool Tomasz. Glad you find it helpful! You could probably create a “close case” link as well, if that would make sense.
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.
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?
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!
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…
Awesome! thanks for the post.
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).
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.
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.
Keep a good job up!
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.
Sorry, Figured out the redirect issue
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
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!
The sf user community is salesforce.com’s greatest asset. Your tips were very helpful and I put them to use immediately.
Thanx,
Paul
Glad you found the post helpful! I agree, users are a great source of tips and cool ideas.
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?
If you set up the Add to Campaign button like it’s shown above, it should drop you on the choose member status page.
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
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.
This is really awesome, thanks for the tip!
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
Duh! I had set it up as New field, Text, formula, Hyperlink
needed 2b New Field, Formula, Text, Hyperlink
Lal
it works really good..thanks
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.
[...] tip from GoKubi, is an oldie, but [...]
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
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
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.
This became a series of posts, and these are the only processes I mapped in detail.