I have a few Custom Actions for a list in SharePoint 2013. Every time one is clicked, it opens in a new tab, which means that very quickly a lot of tabs can get spawned. Is there a way to force the Custom Action (e.g. an edit form) to open in the same tab? I am using SharePoint Designer 2013

I tried putting the following code (with the correct URL) into the Navigate to URL field, based on something I found online, but it doesn't work:

javascript:(function() {var items = SP.ListOperation.Selection.getSelectedItems(); location.href = “/URL-TO-FORM.aspx?ID=”+items[0].id;})()

  • Did you verify the target property for your custom action link/button? May 31, 2017 at 15:52
  • How do I do that? By the way, I am doing this through SharePoint Designer
    – Tom Ato
    May 31, 2017 at 15:53

1 Answer 1


I have created a test custom action using SharePoint designer with below Navigate to URL option

javascript:(function() {var items = SP.ListOperation.Selection.getSelectedItems(); window.location.href= "http://www.google.com";})()

It is opening in the same tab.

  • I guess maybe I just needed the window in there
    – Tom Ato
    May 31, 2017 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.