JSX*_*JSX 0 javascript sharepoint sharepoint-2013 csom
我按照msdn的说明通过JSOM获取WorkflowSubscriptionService.
使用SharePoint 2013 Workflow Services客户端对象模型:http: //msdn.microsoft.com/en-us/library/office/dn481315(v = office.15).aspx
var clientContext = SP.ClientContext.get_current();
var workflowServicesManager = SP.WorkflowServices.WorkflowServicesManager.newObject(clientContext, clientContext.get_web());
var workflowSubscriptionService = workflowServicesManager.getWorkflowSubscriptionService();
Run Code Online (Sandbox Code Playgroud)
这三行总是抛出错误:TypeError:Object [object Object]没有方法'get_context'消息:"Object [object Object]没有方法'get_context'"stack:(...)get stack:function(){ [native code]} set stack:function(){[native code]} proto:Error
我找不到错误.这是一个已知的错误?
由于尚未加载指定的对象,因此会发生这些错误.
要使用SharePoint 2013 Workflow Services客户端对象模型,应加载以下JSOM库:
例如,您可以使用SP.SOD.executeFunc(SharePoint JavaScript库)或jQuery.getScript()(jQuery ibrary)来确保已加载指定的文件.
例:
var scriptbase = _spPageContextInfo.webAbsoluteUrl + "/_layouts/15/";
$.getScript(scriptbase + "SP.js", function () {
$.getScript(scriptbase + "SP.Runtime.js", function () {
$.getScript(scriptbase + "SP.WorkflowServices.js", function () {
var clientContext = SP.ClientContext.get_current();
var workflowServicesManager = SP.WorkflowServices.WorkflowServicesManager.newObject(clientContext, clientContext.get_web());
var workflowSubscriptionService = workflowServicesManager.getWorkflowSubscriptionService();
//...
});
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4241 次 |
| 最近记录: |