Pergunta

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;})()

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top