2010-11-07

SharePoint Designer Custom Action in Dialog

SharePoint designer has a great way to create custom actions. There are many help posts out there on how to do that.
http://blog.furuknap.net/adding-custom-actions-in-sharepoint-designer-2010
You have three options to select "Navigate to form", "Initiate workflow" and "Navigate to URL"
The trouble with these actions and options (well the ones on the View Ribbon) is that they do not open in the dialog box

There a heaps more posts on creating custom actions that open in dialogs
http://www.chakkaradeep.com/post/Using-the-SharePoint-2010-Modal-Dialog.aspx
http://www.vinodunny.com/blog/post/Application-Page-Ribbon-Dialogs-on-SharePoint-2010.aspx
http://jomit.blogspot.com/2009/12/dialog-platform-in-sharepoint-2010-how.html

The problem with those though, is that the action must be defined before hand.
I really like how sharepoint designer allows you to configure the url on the fly.
There must be a way to combine the two ways.

I was hoping that the "Navigate to URL" option would be a href.
So i tried a simple javascript:alert("hi") for an action.
Sure enough i got an alert box.
From there it was just a matter of figuring out the showModalDialog command, and putting it on one line.

This action is great to use with the StartWorkflow component http://spc3.codeplex.com/

For View Ribbon actions
javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/_layouts/Com.CodePlex.SPC3/StartWorkflow.aspx?List={ListId}&ItemID={SelectedItemId}&Workflow=WorkflowName",dialogReturnValueCallback: function(dialogResult, returnValue) { SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK) }})

And for Display Form Ribbon actions
{SiteUrl}/_layouts/Com.CodePlex.SPC3/StartWorkflow.aspx?List={ListId}&ItemID={ItemId}&Workflow=WorkflowName

6 comments:

Anonymous said...

ebook newsgrou http://audiobooksworld.co.uk/Welcome-To-Your-Brain/p23326/ handload ebook [url=http://audiobooksworld.co.uk/Weedon-Grossmith/m131265/]google payday ebook[/url] you publish ebook

Anonymous said...

active speed software http://buyoem.co.uk/fr/product-14304/PassMark-PerformanceTest-v6-1 dvd-r software [url=http://buyoem.co.uk/manufacturer-9/Autodesk]blank check stock for quicken software[/url] panda software portugal
[url=http://buyoem.co.uk/product-18302/Bookdog-Mac]Bookdog [Mac] - Download OEM, Software Sale, OEM Software[/url] bonobo software
[url=http://buyoem.co.uk/es/product-33535/Digital-Anarchy-Beauty-Box-1-0-for-Adobe-Photoshop][img]http://buyoem.co.uk/image/8.gif[/img][/url]

Anonymous said...

[url=http://certifiedpharmacy.co.uk/products/clomid.htm][img]http://onlinemedistore.com/1.jpg[/img][/url]
funny pharmacy joke http://certifiedpharmacy.co.uk/products/tadacip.htm nutri chem pharmacy [url=http://certifiedpharmacy.co.uk/catalogue/p.htm]pharmacy pins[/url]
target pharmacy coupon new http://certifiedpharmacy.co.uk/products/trimox.htm pharmacy benefits [url=http://certifiedpharmacy.co.uk/products/procalisx.htm]procalisx[/url]
walmart pharmacy program http://certifiedpharmacy.co.uk/categories/female-enhancement.htm thc delivery pharmacy [url=http://certifiedpharmacy.co.uk/products/sublingual-viagra.htm]pharmacy researckes[/url]
ohio certified pharmacy tech http://certifiedpharmacy.co.uk/products/bactroban.htm mikee pharmacy [url=http://certifiedpharmacy.co.uk/products/cialis.htm]cialis[/url]

Anonymous said...

[url=http://certifiedpharmacy.co.uk/products/trazodone.htm][img]http://onlinemedistore.com/3.jpg[/img][/url]
list of pharmacy school http://certifiedpharmacy.co.uk/products/ditropan.htm pharmacy penegra pharmacy silagra cumwithuscom [url=http://certifiedpharmacy.co.uk/products/speman.htm]online pharmacy rx[/url]
pharmacy university grade requirements http://certifiedpharmacy.co.uk/products/oxytrol.htm fda pharmacy anxiety [url=http://certifiedpharmacy.co.uk/products/eriacta.htm]eriacta[/url]
phendimetrazine online pharmacy http://certifiedpharmacy.co.uk/products/azulfidine.htm ferris state pharmacy [url=http://certifiedpharmacy.co.uk/categories/blood-pressure.htm]wellington pharmacy[/url]
lake forest park towne center pharmacy http://certifiedpharmacy.co.uk/products/valtrex.htm kroger pharmacy benton arkansas [url=http://certifiedpharmacy.co.uk/products/yasmin.htm]yasmin[/url]

Anonymous said...

[url=http://englandpharmacy.co.uk/products/paxil.htm][img]http://onlinemedistore.com/8.jpg[/img][/url]
sgmc pharmacy http://englandpharmacy.co.uk/categories/antiviral.htm pharmacy history washington state [url=http://englandpharmacy.co.uk/products/rogaine-2-.htm]pharmacy with health clinic findlay ohio[/url]
health pharmacy drugs and medications s sibutramine http://englandpharmacy.co.uk/products/betnovate.htm personal statement pharmacy [url=http://englandpharmacy.co.uk/products/azulfidine.htm]azulfidine[/url]
online pharmacy order http://englandpharmacy.co.uk/products/bactrim.htm diamond pharmacy services [url=http://englandpharmacy.co.uk/products/antabuse.htm]new jersey phentermine pharmacy[/url]
irma lerma rangel college of pharmacy http://englandpharmacy.co.uk/categories/weight-loss.htm las colinas pharmacy [url=http://englandpharmacy.co.uk/products/remeron.htm]remeron[/url]

Jordan J said...

Have you found that if you add "javascript:" to the Natigate to URL portion that when you go back to edit the custom action the radio button has unselected Navitage To URL and instead selected "Initiate Workfow"? This is annoying me. The javascript I typed into the text box is gone, hence any other developer looking at this later will be confused. Bug!