2016-10-04 48 views
0

我制作了自定义工作流程活动,使用Plugin Registration Tool进行了注册,现在我想使用Action来执行它。行动不会有输入/输出参数。唯一的名称是ad_opportunity。它将从自定义实体执行ad_productsamplerequest使用Process.js调用操作 - CRM

我将使用Process.js从JavaScript调用此操作。

我不熟悉Process.js,所以我有一个问题让Action调用。

这是我所做的电话,但它不起作用。我失去了一些东西在这里:在你的代码中提到

Process.callAction("ad_opportunity", 
    [{ 
     key: "Target", 
     type: Process.Type.EntityReference, 
     value: { id: Xrm.Page.data.entity.getId(), entityType: "ad_productsamplerequest" } 
    }], 
    function (params) { 
     //Success 
    }, 
    function (e) { 
     // Error 
     alert(e); 
    } 
); 

回答

1

的价值应该被声明为的EntityReference。请参考下面的代码相同

Process.callAction("mag_Retrieve", 
 
    [{ 
 
     key: "Target", 
 
     type: Process.Type.EntityReference, 
 
     value: new Process.EntityReference("account", Xrm.Page.data.entity.getId()) 
 
    }, 
 
    { 
 
     key: "ColumnSet", 
 
     type: Process.Type.String, 
 
     value: "name, statuscode" 
 
    }], 
 
    function (params) { 
 
     // Success 
 
    }, 
 
    function (e, t) { 
 
     // Error 
 
    });

休息看起来不错