This project is a fork of the Microsoft Dynamics CRM Sdk.Soap.js library (https://code.msdn.microsoft.com/SdkSoapjs-9b51b99a) with support for Universal Module Definition (https://github.com/umdjs/umd). This is especially useful in a AMD loaded environment (e.g. RequireJS).
- Allows to set the value of a Lookup Attribute to null, not just to
Sdk.EntityReference
. - Escapes illegal XML characters during XML serialization.
- Extends the
contains
function ofSdk.Collection
so taht it optionally takes a filter predicate function as argument. Sdk.Collection
has a new methodselect
which returns a subset of the items satisfying a predicate function.Sdk.Entity
has a new methodcontainsAttribute
which checks whether the entity has an attribute that satisfies a predicate function.
There is a TypeScript definition available: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/microsoft-sdk-soap.
require.config( {
paths: {
// Core library
"Sdk": "<FilePath>/Sdk.Soap",
// Optional message plug-ins
"Sdk.RetrieveMetadataChanges": "<FilePath>/Sdk.RetrieveMetadataChanges",
"Sdk.SetState": "<FilePath>/Sdk.SetState",
...
}
} );
define( ["Sdk"], function( Sdk )
{
var query = new Sdk.Query.QueryByAttribute( "account" );
query.addColumn( "name" );
query.addAttributeValue( new Sdk.String( "accountnumber", "12345" ) );
Sdk.Q.retrieveMultiple( query );
} );
Loading optional messages results in a modified Sdk reference:
define( ["Sdk.RetrieveMetadataChanges"], function( Sdk )
{
Sdk.Mdq !== undefined; // true
} );