Quantcast
Channel: XrmServiceToolkit - A Microsoft Dynamics CRM 2015/2013/2011 JavaScript Library
Viewing all 589 articles
Browse latest View live

Commented Issue: Object doesn't support property or method 'selectSingleNode' error on Soap.Create [1262]

$
0
0
Getting " Object doesn't support property or method 'selectSingleNode' " script error while creating records using SOAP.Create() method.
This was working few weeks back and its become show stopper. Any fix/Workaround really help.
Comments: ** Comment from web user: jaimieji **

Hi There

selectSingleNode has been removed from the latest version and it should not be used as well if you have modified the toolkit and for future CRM development to support cross broswer

Which version are you using at the moment?

Jaimie


Closed Issue: Recieved access denied when calling .SOAP.getServerUrl [1152]

$
0
0
We are getting an 'Access Denied' when we are using a fully qualified URL but we do not get the error when we just use our machine name: Access Denied when (http://machinename.domain.com/org/...) No error when (http://machinename/org/...)

I saw this blog: http://www.madronasg.com/blog/dynamics-crm-2011-javascript-%E2%80%9Caccess-denied%E2%80%9D-error-ajax-call#.UR5Bc6Vwps4

and changed our version of the code to be:
var getServerUrl = function () {
///
/// Private function to return the server URL from the context
///
///String
///var serverUrl = context().getServerUrl();
///if (serverUrl.match(/\/$/)) {
/// serverUrl = serverUrl.substring(0, serverUrl.length - 1);
///}
var serverUrl = document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
return serverUrl;
};

We are not getting the error any more. Also we are at CRM 2011 RU12v2 onpremise.

What do you think?

Closed Issue: error The SDK request could not be deserialized [1244]

$
0
0
I have this error for a week
I use the last version 1.4. and CRM rollup 12

<error>
<code>0x8004416f</code>
<description>The SDK request could not be deserialized.</description>
<type>Platform</type>
</error>

the code

var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
GenerateAuthenticationHeader() +
"<soap:Body>" +
"<Execute xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<Request xsi:type=\"ExecuteWorkflowRequest\">" +
"<EntityId>" + crmForm.ObjectId + "</EntityId>" +
"<WorkflowId>" + WorkflowId + "</WorkflowId>" + //WorkflowId = guid of the workflow
"</Request>" +
"</Execute>" +
"</soap:Body>" +
"</soap:Envelope>";

var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Execute");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;

Closed Issue: getCurrentUserId - Cannot convert the XML string to a cross-browser XML object. [1236]

$
0
0
After installing Rollup 12-13, I get "Cannot convert the XML string to a cross-browser XML object." when callling XrmServiceToolkit.Soap.GetCurrentUserId().

Closed Issue: Soap.Execute issue with selectsinglenode [1246]

$
0
0
This worked prior to UR 12.

Console error from developertoolkit reveals

"SCRIPT438: Object doesn't support property or method 'selectSingleNode' ".

Code snippet (error is on response.selectSingleNode - see below)

```
function executeWorkflow(entityId, workflowId, successCallback, errorCallback) {
var requestMain = ""
requestMain += " <request i:type=\"b:ExecuteWorkflowRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\" xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">";
requestMain += " <a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">";
requestMain += " <a:KeyValuePairOfstringanyType>";
requestMain += " <c:key>EntityId</c:key>";
requestMain += " <c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">" + entityId + "</c:value>";
requestMain += " </a:KeyValuePairOfstringanyType>";
requestMain += " <a:KeyValuePairOfstringanyType>";
requestMain += " <c:key>WorkflowId</c:key>";
requestMain += " <c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">" + workflowId + "</c:value>";
requestMain += " </a:KeyValuePairOfstringanyType>";
requestMain += " </a:Parameters>";
requestMain += " <a:RequestId i:nil=\"true\" />";
requestMain += " <a:RequestName>ExecuteWorkflow</a:RequestName>";
requestMain += " </request>";

// Execute it
var response = XrmServiceToolkit.Soap.Execute(requestMain, function (response) {
var workflowId = response.selectSingleNode('//a:KeyValuePairOfstringanyType[c:key=\'Id\']/c:value').nodeTypedValue;
successCallback(workflowId);
}, errorCallback);
}
```

Commented Issue: Object doesn't support property or method 'selectSingleNode' error on Soap.Create [1262]

$
0
0
Getting " Object doesn't support property or method 'selectSingleNode' " script error while creating records using SOAP.Create() method.
This was working few weeks back and its become show stopper. Any fix/Workaround really help.
Comments: ** Comment from web user: CRMdev2013 **

Hi Jaimie,

I was not having the latest version earlier, I downloaded latest version and it is working fine with latest version.

Thank you so much.

New Post: $ Is Undefined

$
0
0
I have been using version 1.1 of this tooklit for a year now and it is awesome. Saved me a ton of time and I have built a pretty lengthy utility library on top of it.

However I now have an issue. I have an environment that is on-premise R12. I had a solution built online that I imported to the on-premise solution.

In my on-premise version, I am getting the error "Object doesn’t support property or method selectSingleNode". As noted elsewhere in the discussions, I upgraded to 1.4.1. Simply created a new Web Resource with the 1.4.1 code and swapped it out on my form.

On the same code that was working with R13 online, I am now getting:
"Error: '$' is undefined"

There are no dollar signs in my own code other than in an unrelated regexp.

Any ideas? Thanks again for a great product.

New Post: $ Is Undefined

$
0
0
Hi There.

$ is used by jQuery library. The latest library requires jQuery, JSON2 to be loaded before the functions of XrmServiceToolkit library being called.

The requirement of jQuery library was introduced around 1.2 if I remember it right. Try to add jQuery library in and let me know if that solves your issue.

The other possibility is because RU13 is loading JavaScript libraries asynchronously which may also cause some issues.

http://community.dynamics.com/crm/b/magnetismsolutionscrmblog/archive/2013/03/03/crm-2011-polaris-asynchronous-javascript-loading.aspx

Hope this helps.

Jaimie

New Post: Revised SOAP.queryAll and SOAP.fetchMore to allow sort order (asc or desc) parameter to be passed

$
0
0
Hi There.

Thanks for doing this. I will have a look at the code soon.

Regards,
Jaimie

New Post: $ Is Undefined

$
0
0
Thanks for the quick reply. I installed the jQuery piece in conjunction with the core 1.4.1. code and it works fine now.

Closed Issue: addNotification not working after Update Rollup 12 [Fixed for next release] [1150]

$
0
0
The function "addNotification = function (message, level)" isn't working anymore after updating Dynamics CRM 2011 with the Rollup 12.

Closed Issue: Fetch: Data from linked entites not formatted [Fixed for next release] [1129]

$
0
0
Hi,
When executing a fetch Xml that contains link-entity, the value returned is not formatted and concatenate entity name, attribute name and actual value.

I updated the method deserialize with the following:

else if (entCv.type == "boolean") {
entCv.value = ($(attr).children().eq(k).children().eq(1).text() == 'false') ? false : true;
}
// My Code
else if (entCv.type == "AliasedValue") {
entCv.value = $(attr).children().eq(k).children().eq(1).children().eq(2).text();

if ($(attr).children().eq(k).children().eq(1).children().eq(2).attr("i:type") == "a:EntityReference") {
entCv = new xrmEntityReference();
entCv.type = "EntityReference";
entCv.id = $(attr).children().eq(k).children().eq(1).children().eq(2).children().eq(0).text();
entCv.logicalName = $(attr).children().eq(k).children().eq(1).children().eq(2).children().eq(1).text();
entCv.name = $(attr).children().eq(k).children().eq(1).children().eq(2).children().eq(2).text();
}
}

// End of my code
else {
entCv.value = $(attr).children().eq(k).children().eq(1).text();
}

Source code checked in, #23386

$
0
0
Updated SLN file to open in VS2012 and VS2010

Source code checked in, #23389

$
0
0
v1.4.2 (beta); Changed getServerUrl to getClientUrl, added "fetchAll" boolean parameter to fetch method, to implement paged fetch using fetchMore(); added value array processing for joinConditionPair(), so multiple values can be added as conditions using the "in" operator. Added handling to fetch() to work with and without "<fetch>" elements (preferably without). Removed redundant code.

Source code checked in, #23390

$
0
0
Added my author information, and updated version tag with "beta" qualifier

Source code checked in, #23393

$
0
0
Added TypeScript definition file for XrmServiceToolkit

Source code checked in, #23395

$
0
0
Fixed bugs with "indexOf" (doesn't work in IE), and invalid "join" call. :P Sorry.

New Post: Revised SOAP.queryAll and SOAP.fetchMore to allow sort order (asc or desc) parameter to be passed

$
0
0
Codeplex is not very good for collaborating. Can you, please, transfer development to GitHub and use Codeplex for stable releases?

New Post: xrmservicetoolkit is undefined

$
0
0
I have downloaed the toolkit as well as the solution. I have installed the solution I have tried everything I can to get this to work.

Background:

I have a js that gets called when I click an icon on the ribbon bar. What I want to do is take a hand full of fields from this entity and add a record to the new entity. As soon as I turn debugging on I get xrmservicetoolkit is undefined. There is no html involved so I can't include script tags.

Thanks in advance for any help you can provide.

// Covert Lot to Great Car
/// <reference path="ISV/CRMServiceToolkit/XrmServiceToolkit.js" />

function addgreat() {
var year = Xrm.Page.data.entity.attributes.get("esi_year").getValue();

// Here is where I get the undefined.
    var beGreatCar = XrmServiceToolkit.Soap.businessEntity("esi_car");

 beGreatCar.attributes["esi_year"] = Xrm.Page.data.entity.attributes.get("esi_year").getValue();
    beGreatCar.attributes["esi_make"] = Xrm.Page.data.entity.attributes.get("esi_make").getValue();
    beGreatCar.attributes["esi_model"] = Xrm.Page.data.entity.attributes.get("esi_model").getValue();
    beGreatCar.attributes["esi_chassissnumber"] = Xrm.Page.data.entity.attributes.get("esi_chassisnumber").getValue();
    beGreatCar.attributes["esi_enginenumber"] = Xrm.Page.data.entity.attributes.get("esi_enginenumber").getValue();
    beGreatCar.attributes["esi_bodystyle"] = Xrm.Page.data.entity.attributes.get("esi_bodystyle").getValue();
    beGreatCar.attributes["esi_coachworkby"] = Xrm.Page.data.entity.attributes.get("esi_bodyby").getValue();
    beGreatCar.attributes["esi_bodynumber"] = Xrm.Page.data.entity.attributes.get("esi_bodynumber").getValue();

    // Check for last know owner. Make it the buyer unless that is blank then make it the seller

    if (Xrm.Page.data.entity.attributes.get("esi_bidregbuyerid").getValue() != null) {
        beGreatCar.attributes["esi_contactid"] = Xrm.Page.data.entity.attributes.get("esi_bidregbuyerid").getValue();
    } else {

       beGreatCar.attributes["esi_contactid"] = Xrm.Page.data.entity.attributes.get("esi_sellerid").getValue();
    };

    oService.Create(beGreatCar);
    alert(year + " Added to Great Cars.");        
    }

Source code checked in, #23458

$
0
0
Fixed method signature bug for "Fetch"; updated "reference" doc element to point to the proper namespace of the Xrm2011 TS definition file
Viewing all 589 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>