1

I create a dynamic link to the workflow Midification form in SharePoint 2010. I can get all of required parameters such as ItemID, ListId and Workflow InstanceId via Javascript OM. The only problem parameter is "ModificationID", which is created new for any instance of my SharePoint designer Workflow.

Can anyone maybe tell me how can i get ModificationID of current workflow instace via JavaScript OM.

Here ist my code for creating the dynamic link:

 


$.urlParam = function(name){
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
    return results[1] || 0;
}

function NavigateToCreateNewTaskWF() {
    var clientContext = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl);

    var oList = clientContext.get_web().get_lists().getByTitle('ESTIMATION');
    var id = $.urlParam('SelectedID');

    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('' + 
        '' + id + '1');
    this.collListItem = oList.getItems(camlQuery);        
    clientContext.load(collListItem);

    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));        

}

function onQuerySucceeded(sender, args) {
    var estimationID = $.urlParam('SelectedID');
    var estimationListID = '9c93f69d-7d95-4f79-9ce4-e4af552a0ae5'; 

    var wfInstanceId = '';

    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
                wfInstanceId = oListItem.get_item('WFEstimationItemCollectionID');

    }

    window.location.href ='http://...../_layouts/ModWrkflIP.aspx?ID='+ estimationID
                            + '&List='+estimationListID + '&WorkflowInstanceID={'+ wfInstanceId 
+ '}&ModificationID='+'.....';
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

+ Add new Item



 
0

As I know there is no way to get it by JavaScript. If you have the chance to create your own helper service as farm code, you can deliver it via your own service as a bridge to your javascript code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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