Skip to main content

Hi,

I have a workflow that is going to create a document set, is there anyway to run a redirect that after the workflow is run and the document set is created it will open it up in a new tab or window?

Thanks!

Kimberley

workflow runs in the background on the server so it has no way to interact with client desktop.

you can either redirect a form to document library or you can send a notification from workflows that will contain direct link to new document set.


Hi Kimberley Morrison​,

You can do this but you'd need to start your workflow using script.

Use SharePoint's client side rendering to create a button on a form or in a list view to start your workflow using the Nintex web service, I've pasted a function below that will do the job. You'll need to tweak it to include a poll to see if your document set is created and then redirect once it's there.

function startworkflowonlistitem(wfName, itemId, listName )
{
    var associationData = '';
    var webMethod =  _spPageContextInfo.webAbsoluteUrl + '/_vti_bin/NintexWorkflow/Workflow.asmx';
    var soap= "<?xml version=""1.0"" encoding=""utf-8""?>" +
                            "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=""http://www.w3.org/2001/XMLSchema" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/">" +
                              "<soap:Body>" +
                                "<StartWorkflowOnListItem xmlns=""http://nintex.com">" +
                                  "<itemId>" + itemId + "</itemId>" +
                                  "<listName>" + listName + "</listName>" +
                                  "<workflowName>" + wfName + "</workflowName>" +
                                  "<associationData></associationData>" +
                                "</StartWorkflowOnListItem>" +
                              "</soap:Body>" +
                            "</soap:Envelope>";

    $.ajax({
        type: "POST",
        url: webMethod,
        beforeSend: function(xhr) { xhr.setRequestHeader("SOAPAction", "http://nintex.com/StartWorkflowOnListItem");},
        data: soap,
        contentType: "text/xml; charset=utf-8",
        dataType: "xml",
        success: function(data) {alert("The workflow has been started");},
        error: function (e) { alert('The workflow has failed to start because it is already in progress'); }

    });
}

Hope that helps.

Jan


Reply