I am trying to start a workflow from JSOM. I just had it working fine, and then I had to change some of the other code in the JavaScript file that is unrelated to the client context or executing queries, and now when I try context.load(clientObject), I get

Uncaught TypeError: a.get_$y_0 is not a function

from SP.Runtime.js.

I can see that SP.js, SP.Core.js, SP.Runtime.js and SP.WorkflowServices.js are all loaded.

Here's my code:

MyNamespace.getWfSubscriptions = function () {
    var listID = _spPageContextInfo.pageListId;
    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getById(listID);

    MyNamespace.wfServicesManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, web);
    // I get the error right here, at the first context.load()

    MyNamespace.wfSubscriptions = MyNamespace.wfServicesManager.getWorkflowSubscriptionService().enumerateSubscriptionsByList(new SP.Guid(listID));
    context.executeQueryAsync(MyNamespace.startWorkflow, MyNamespace.showErrorNotification);

Again, this function is untouched from when it was working just earlier today.

Anyone have any idea as to what is going wrong here or what I might be missing?

Your Answer

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

Browse other questions tagged or ask your own question.