Hello I am having an error when using the execute action method in the Node.js package. I am unable to determine if the error is due to the package or my setup.
When using execute action with the QualifyLead action I receive the following error response
{ response: '{\r\n "error":{\r\n "code":"","message":"Request message has unresolved parameters.","innererror":{\r\n "message":"Request message has unresolved parameters.","type":"Microsoft.Crm.CrmHttpException","stacktrace":" at Microsoft.Crm.Extensibility.OData.CrmODataRoutingConvention.SelectAction(ODataPath odataPath, HttpControllerContext controllerContext, ILookup`2 actionMap)\\r\\n at System.Web.OData.Routing.ODataActionSelector.SelectAction(HttpControllerContext controllerContext)\\r\\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"\r\n }\r\n }\r\n}',
headers:
{ 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-type': 'application/json; odata.metadata=minimal',
expires: '-1',
server: 'Microsoft-IIS/8.5',
req_id: 'd209d3a2-2193-4398-aaca-9f1564efc916',
'odata-version': '4.0',
'x-aspnet-version': '4.0.30319',
'x-powered-by': 'ASP.NET',
date: 'Mon, 02 Jan 2017 21:10:56 GMT',
connection: 'close',
'content-length': '719',
'set-cookie': [ 'crmf5cookie=!PW41x9uFy6IZ3b+9a0vrIWFrFaeDpFUcsH/WFpVQKiR8r7ngE7eQgT9vpXiS7XbW7Nq/92zrL/wtkiM=;secure; path=/' ],
'strict-transport-security': 'max-age=31536000; includeSubDomains' } }
I have setup the parameters using the following page as a guide.
below is the code I am running with sensitive data redacted.
var CRMWebAPI = require('CRMWebAPI');
var apiconfig = { APIUrl: 'https://myorghere.crm.dynamics.com/api/data/v8.0/', AccessToken: "access_token_here"};
var crmAPI = new CRMWebAPI(apiconfig);
console.log('hello')
var queryOptions = {
Top:10,
// Select:['firstname', 'statecode'],
Filter: "_createdby_value eq <userid>"
//Filter: "statecode eq 0"
}
crmAPI.GetList('leads', queryOptions).then((response)=>{
//console.log(response);
//using 4th index as I know it is an unqualified lead. This is for testing.
var id = response.List[3].leadid;
var params = {
"CreateAccount": false,
"CreateContact": true,
"CreateOpportunity":false,
"OpportunityCurrencyId":"currency_id_here",
"OpportunityCustomerId":null,
"SourceCampaignId":null,
"Status": 3,
"ProcessInstanceId":id
};
crmAPI.ExecuteAction('Microsoft.Dynamics.CRM.QualifyLead', params, 'leads' , id).then(function(res){
console.log(res);
}).catch((error)=>{
console.log(error)
})
}).catch((error)=>{
console.log(error)
})
Any help you could provide I greatly appreciate.
If the error is with my setup and not with the package I apologize for the issue in advance.