COSA.Request

Classes

AddListMembersList message

Constructor

new COSA.Request.AddListMembersList(listId, memberIds, requestId)

Param Type Description
listId string List unique identifier (GUID)
memberIds Array.<string> Members unique identifiers (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
listId string List unique identifier (GUID)
memberIds Array.<string> Members unique identifiers (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var addListMemberList_0 = new COSA.Request.AddListMembersList(
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        ['XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX']
    );

//message execution
addListMembersList_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(addListMembersList_0, function ( r ) {
	//working with a response
});

Back to Top

AddMemberList message

Constructor

new COSA.Request.AddMemberList(listId, entityId, requestId)

Param Type Description
listId string List unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
listId string List unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var addMemberList_0 = new COSA.Request.AddMemberList(
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    );

//message execution
addListMember_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(addListMember_0, function ( r ) {
	//working with a response
});

Back to Top

Assign message

Constructor

new COSA.Request.Assign(target, asignee, requestId)

Param Type Description
target COSA.EntityReference Target
assignee COSA.EntityReference Assignee
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
target COSA.EntityReference Target
assignee COSA.EntityReference Assignee
requestId (optional) string Request unique identifier (GUID)

Example

var assign_0 = new COSA.Request.Assign(new COSA.EntityReference('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        							   new COSA.EntityReference('systemuser', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'));
//message execution
assign_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(assign_0, function ( r ) {
	//working with a response
});

Back to Top

Associate message

Associate message

Constructor

new COSA.Request.Associate(relationshipSchemaName, target, relatedEntities, requestId)

Param Type Description
relationshipSchemaName string Relationship Schema Name
target COSA.EntityReference Target
relatedEntities Array.<COSA.EntityReference> Related Entities Collection
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
relationshipSchemaName string Relationship Schema Name
target COSA.EntityReference Target
relatedEntities Array.<COSA.EntityReference> Related Entities

Example

var associate_0 = new COSA.Request.Associate('contactleads_association',
        new COSA.EntityReference('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        [
            new COSA.EntityReference('lead', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
            new COSA.EntityReference('lead', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
        ]
    );
//message execution
associate_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(associate_0, function ( r ) {
	//working with a response
});

Back to Top

CopyMembersList message

Constructor

new COSA.Request.CopyMembersList(sourceListId, targetListId, requestId)

Param Type Description
sourceListId string Source List unique identifier (GUID)
targetListId string Target List unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
sourceListId string Source List unique identifier (GUID)
targetListId string Target List unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var copyMembersList_0 = new COSA.Request.CopyMembersList(
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    );

//message execution
copyMembersList_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(copyMembersList_0, function ( r ) {
	//working with a response
});

Back to Top

Create message

Create message

Constructor

new COSA.Request.Create(entity, requestId)

Param Type Description
entity COSA.BusinessEntity Entity to create
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Param Type Description
entity COSA.BusinessEntity Entity to update
requestId (optional) string Request unique identifier (GUID)

Example

var name = COSA.Util.formatString('#{0}', (new Date()).getMilliseconds()),
    contact_0 = new COSA.BusinessEntity('contact', null, {
        lastname: new COSA.XrmString(name),
        emailaddress1: new COSA.XrmString(COSA.Util.formatString('{0}@mail.com', name)),
        creditlimit: new COSA.XrmMoney(100.50),
        numberofchildren: new COSA.XrmWholeNumber(2),
        creditonhold: new COSA.XrmBoolean(true),
        parentcustomerid: new COSA.EntityReference('account', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        gendercode: new COSA.OptionSetValue(1),
        birthdate: new COSA.XrmDateTime(new Date()),
        address1_latitude: new COSA.XrmDouble(14.55)
    });

//message execution
(new COSA.Request.Create(contact_0)).execute(function ( r ) {
	//working with a response
});
//or
var createRequest_0 = new COSA.Request.Create(contact_0);
COSA.Core.Execute(createRequest_0, function ( r ) {
	//working with a response
});

Back to Top

Delete message

Delete message

Constructor

new COSA.Request.Delete(logicalName, id, requestId)

Param Type Description
logicalName string Entity logical name
id string Entity to delete unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
logicalName string Entity logical name
id string Guid-like string as Entity unique identifier
requestId (optional) string Guid-like string as Request unique identifier

Example

(new COSA.Request.Delete('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'))
    .execute(function ( r ) {
       //Working with a response
    });
//or
var deleteRequest_0 = new COSA.Request.Delete('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');
COSA.Core.Execute(deleteRequest_0, function ( r ) {
	//Working with a response
});

Back to Top

Disassociate message

Constructor

new COSA.Request.Disassociate(relationshipSchemaName, target, relatedEntities, requestId)

Param Type Description
relationshipSchemaName string RelationshipSchemaName
target COSA.EntityReference Target
relatedEntities Array.<COSA.EntityReference> Related Entities
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
relationshipSchemaName string RelationshipSchemaName
target COSA.EntityReference Target
relatedEntities Array.<COSA.EntityReference> Related Entities

Example

var disassociate_0 = new COSA.Request.Disassociate('contactleads_association',
        new COSA.EntityReference('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        [
            new COSA.EntityReference('lead', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
            new COSA.EntityReference('lead', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
        ]
    );

//message execution
disassociate_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(disassociate_0, function ( r ) {
	//working with a response
});

Back to Top

ExecuteMultiple message

Constructor

new COSA.Request.ExecuteMultiple(requests, settings, requestId)

Param Type Description
requests COSA.OrganizationRequestCollection Requests collection
settings COSA.ExecuteMultipleSettings ExecuteMultiple request settings
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type
requests COSA.OrganizationRequestCollection
settings COSA.ExecuteMultipleSettings
requestId (optional) string

Example

var be_0 = new COSA.BusinessEntity("contact", null, {
		firstname: 'Michael',
		lastname: 'Jackson',
		primaryemail:'mjackson@mail.com'}),
    createRq = new COSA.Request.Create(be_0),
    deleteRq = new COSA.Request.Delete('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
    execMultRqs = new COSA.OrganizationRequestCollection([createRq, deleteRq]),
    execMultSett = new COSA.ExecuteMultipleSettings(true, false),
    execMultRq = new COSA.Request.ExecuteMultiple(execMultRqs, execMultSett);

//message execution
execMultRq.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(execMultRq, function ( r ) {
	//working with a response
});

Back to Top

ExecuteWorkflow message

Constructor

new COSA.Request.ExecuteWorkflow(workflowId, entityId, requestId)

Param Type Description
workflowId string Workflow unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
workflowId string Workflow unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var workflowId = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
    entityId = 'YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY',
    executeWorkflow_0 = new COSA.Request.ExecuteWorkflow(workflowId, entityId);

//message execution
executeWorkflow_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(executeWorkflow_0, function ( r ) {
	//working with a response
});

Back to Top

LoseOpportunity message

Constructor

new COSA.Request.LoseOpportunity(opportunityClose, status, requestId)

Param Type Description
opportunityClose COSA.BusinessEntity Opportunity Close Entity
status number Status
requestId (optional) string Request Unique Identifier (GUID)

Properties

Name Type Description
opportunityClose COSA.BusinessEntity Opportunity Close Entity
status number Status
requestId (optional) string Request Unique Identifier (GUID)

Example

var be = new COSA.BusinessEntity('opportunityclose', null, {
        'opportunityid': new COSA.EntityReference('opportunity', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
    });
var loseOpportunity_0 = new COSA.Request.LoseOpportunity(be, 4);

//message execution
loseOpportunity_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(loseOpportunity_0, function ( r ) {
	//working with a response
});

Back to Top

QualifyLead message

Constructor

new COSA.Request.QualifyLead(lead, createAccount, createContact, createOpportunity, status, requestId)

Param Type Description
lead COSA.EntityReference Lead
createAccount boolean Create Account
createContact boolean Create Contact
createOpportunity boolean Create Opportunity
status number Lead Status
requestId (optional) string Request Unique Identifier (GUID)

Properties

Name Type Description
lead COSA.EntityReference Lead
createAccount boolean Create Account
createContact boolean Create Contact
createOpportunity boolean Create Opportunity
status number Lead Status
sourceCampaignId string Source Campaign unique identifier (GUID)
opportunityCurrencyId string Opportunity Currency unique identifier (GUID)
opportunityCustomerId string Opportunity Customer unique identifier (GUID)
requestId (optional) string Request Unique Identifier (GUID)

Example

var qualifyLead_0 = new COSA.Request.QualifyLead(
		new COSA.EntityReference('lead', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        true,
        true,
        false,
        3);

//message execution
qualifyLead_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(qualifyLead_0, function ( r ) {
	//working with a response
});

Back to Top

RemoveMemberList message

Constructor

new COSA.Request.RemoveMemberList(listId, entityId, requestId)

Param Type Description
listId string List unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
listId string List unique identifier (GUID)
entityId string Entity unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var removeMemberList_0 = new COSA.Request.RemoveMemberList(
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    );
//message execution
removeMemberList_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(removeMemberList_0, function ( r ) {
	//working with a response
});

Back to Top

Retrieve message

Retrieve message

Constructor

new COSA.Request.Retrieve(logicalName, id, columnSet, requestId)

Param Type Description
logicalName string Entity Logical Name
id string Entity Unique Identifier
columnSet Array.<string> Requested columns
requestId (optional) string Unique Request Identifier

Instance Properties

Name Type Description
logicalName string Entity Logical Name
id string Entity Unique Identifier
columnSet Array.<string> Requested columns
requestId (optional) string Unique Request Identifier

Example

var retrieve_0 = new COSA.Request.Retrieve('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
    [ 'fullname',
    	'birthdate',
        'emailaddress1',
        'creditlimit',
        'numberofchildren',
        'creditonhold',
        'parentcustomerid',
        'gendercode',
        'address1_latitude'
    ]);
//message execution
retrieve_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(retrieve_0, function ( r ) {
	//working with a response
});

Back to Top

RetrieveAllEntities message

Constructor

new COSA.Request.RetrieveAllEntities(filters, retrieveAsIfPublished, requestId)

Param Type Description
filters COSA.EntityFilters Entity Filters
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
entityFilters COSA.EntityFilters EntityFilters
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Example

var retrieveAllEntities_0 = new COSA.Request.RetrieveAllEntities(COSA.Const.EntityFilters.Attributes, true);
//message execution
retrieveAllEntities_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(retrieveAllEntities_0, function ( r ) {
	//working with a response
});

Back to Top

RetrieveAttribute message

Constructor

new COSA.Request.RetrieveAttribute(entityLogicalName, attrLogicalName, retrieveAsIfPublished, requestId)

Param Type Description
entityLogicalName string Entity Logical Name
attrLogicalName string Attribute LogicalName
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
entityLogicalName string Entity Logical Name
attributeLogicalName string Attribute Logical Name
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Example

var retrieveAttribute_0 = new COSA.Request.RetrieveAttribute('contact', 'creditlimit', true);
//message execution
retrieveAttribute_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(retrieveAttribute_0, function ( r ) {
	//working with a response
});

Back to Top

RetrieveEntity message

Constructor

new COSA.Request.RetrieveEntity(logicalName, filters, retrieveAsIfPublished, requestId)

Param Type Description
logicalName string Entity logical name
filters COSA.EntityFilters Entity filters
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
logicalName string Entity Logical Name
entityFilters COSA.EntityFilters EntityFilters
retrieveAsIfPublished boolean Retrieve As If Published
requestId (optional) string Request unique identifier (GUID)

Example

var retrieveEntity_0 = new COSA.Request.RetrieveEntity('contact', COSA.Const.EntityFilters.All, true);
//message execution
retrieveEntity_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(retrieveEntity_0, function ( r ) {
	//working with a response
});

Back to Top

RetrieveMetadataChanges message

Constructor

new COSA.Request.RetrieveMetadataChanges(query, clientVersionStamp, deletedMetadataFilters, requestId)

Param Type Description
query COSA.MetadataFilterExpression Query
clientVersionStamp string Client Version Stamp
deletedMetadataFilters COSA.DeletedMetadataFilters Deleted Metadata Filters
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
query COSA.MetadataFilterExpression Query
clientVersionStamp string Client Version Stamp
deletedMetadataFilters COSA.DeletedMetadataFilters Deleted Metadata Filters
requestId (optional) string Request unique identifier (GUID)

Example

var subFilterExpression_0 = new COSA.MetadataFilterExpression(COSA.Const.FilterOperator.OR,
        [
            new COSA.MetadataConditionExpression(COSA.Const.MetadataConditionOperator.Equals, 'IsDuplicateDetectionEnabled', new COSA.XrmBoolean(true)),
            new COSA.MetadataConditionExpression(COSA.Const.MetadataConditionOperator.NotEquals, 'IconLargeName', null)
        ]),
        rootFilterExpression_0 = new COSA.MetadataFilterExpression(COSA.Const.FilterOperator.AND,
            [
                new COSA.MetadataConditionExpression(COSA.Const.MetadataConditionOperator.Equals, 'IsCustomEntity', new COSA.XrmBoolean(true))
            ],
            [
                subFilterExpression_0
            ]
        ),
        attributeQuery = new COSA.AttributeQueryExpression(
            new COSA.MetadataFilterExpression(COSA.Const.FilterOperator.AND,
                [
                    new COSA.MetadataConditionExpression(COSA.Const.MetadataConditionOperator.Equals,
                        'Format',
                        new COSA.DateTimeFormat(COSA.Const.DateTimeFormat.DateAndTime))
                ]
            ),
            ['Format', 'LogicalName']
        ),
        entityQueryExpression_0 = new COSA.EntityQueryExpression( rootFilterExpression_0,
            ['LogicalName', 'IconLargeName', 'IsDuplicateDetectionEnabled', 'Attributes', 'OneToManyRelationships'],
            attributeQuery
        ),
        retrieveMetadataChangesRequest_0 = new COSA.Request.RetrieveMetadataChanges(entityQueryExpression_0);

retrieveMetadataChangesRequest_0.execute(function ( resp ) { console.log('RetrieveMetadataChanges'); });

var rootFilterExpression_1 = new COSA.MetadataFilterExpression(COSA.Const.FilterOperator.AND, [
    new COSA.MetadataConditionExpression(COSA.Const.MetadataConditionOperator.Equals, 'IsCustomEntity', new COSA.XrmBoolean(true))
]),
    retrieveMetadataChanges_1 = new COSA.Request.RetrieveMetadataChanges(new COSA.EntityQueryExpression(
        rootFilterExpression_1,
        []
    ), '', COSA.DeletedMetadataFilters(COSA.Const.DeletedMetadataFilters.All));

retrieveMetadataChanges_1.execute(function ( e ) { console.log('retrieveMetadataChanges1'); });

Back to Top

RetrieveMultiple message

RetrieveMultiple message

Constructor

new COSA.Request.RetrieveMultiple(queryExpression, requestId)

Param Type Description
queryExpression COSA.QueryExpression Query Expression object
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
queryExpression COSA.QueryExpression Query Expression object

Example

var fe_0 = new COSA.FilterExpression(COSA.Const.FilterOperator.AND,
        [
            new COSA.ConditionExpression('lastname', COSA.Const.ConditionOperator.Like, [new COSA.XrmString('#%')])
        ]
    ),
    qe_0 = new COSA.QueryExpression('contact', new COSA.ColumnSet(['lastname', 'emailaddress1', 'creditlimit']), fe_0);
qe_0.orders = [
    new COSA.OrderExpression('lastname', COSA.Const.OrderType.Asc),
    new COSA.OrderExpression('firstname', COSA.Const.OrderType.Desc)
];

var retrieveMultiple_0 = new COSA.Request.RetrieveMultiple(qe_0);
//message execution
retrieveMultiple_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(retrieveMultiple_0, function ( r ) {
	//working with a response
});

Back to Top

RetrievePrincipalAccess message

Constructor

new COSA.Request.RetrievePrincipalAccess(principal, target, requestId)

Param Type Description
principal COSA.EntityReference Principal
target COSA.EntityReference Target
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
principal COSA.EntityReference Principal
target COSA.EntityReference Target
requestId (optional) string Request unique identifier (GUID)

Example

var retrievePrincipalAccess_0 = new COSA.Request.RetrievePrincipalAccess(
        new COSA.EntityReference('systemuser', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        new COSA.EntityReference('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
    );

//message execution
retrievePrincipalAccess_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(retrievePrincipalAccess_0, function ( r ) {
	//working with a response
});

Back to Top

RetrieveUserPrivileges message

Constructor

new COSA.Request.RetrieveUserPrivileges(userId, requestId)

Param Type Description
userId string User unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
userId string User unique identifier (GUID)
requestId (optional) string Request unique identifier (GUID)

Example

var retrieveUserPrivileges_0 = new COSA.Request.RetrieveUserPrivileges('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');
//message execution
retrieveUserPrivileges_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(retrieveUserPrivileges_0, function ( r ) {
	//working with a response
});

Back to Top

SetState message

Constructor

new COSA.Request.SetState(entityMoniker, state, status, requestId)

Param Type Description
entityMoniker COSA.EntityReference Entity Moniker
state number State
status number Status
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
entityMoniker COSA.EntityReference Entity Moniker
state number State
status number Status
requestId (optional) string Request unique identifier (GUID)

Example

var setState_0 = new COSA.Request.SetState(new COSA.EntityReference('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'), 1, 2);
//message execution
setState_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(setState_0, function ( r ) {
	//working with a response
});

Back to Top

Update message

Update message

Constructor

new COSA.Request.Update(entity, requestId)

Param Type Description
entity COSA.BusinessEntity Entity to update
requestId (optional) string Request unique identifier (GUID)

Instance Properties

Name Type Description
entity COSA.BusinessEntity Entity

Example

var contact_1 = new COSA.BusinessEntity('contact', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');
contact_1.attributes.creditlimit = new COSA.XrmMoney(500.14);
contact_1.attributes.numberofchildren = new COSA.XrmWholeNumber(3);
contact_1.attributes.creditonhold = new COSA.XrmBoolean(false);
contact_1.attributes.gendercode = new COSA.OptionSetValue(2);
contact_1.attributes.birthdate = new COSA.XrmDateTime(new Date());
contact_1.attributes.address1_latitude = new COSA.XrmDouble(15.55);

var updateRequest_0 = new COSA.Request.Update(contact_1);
//message execution
updateRequest_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Core.Execute(updateRequest_0, function ( r ) {
	//working with a response
});

Back to Top

WinOpportunity message

Constructor

new COSA.Request.WinOpportunity(opportunityClose, status, requestId)

Param Type Description
opportunityClose COSA.BusinessEntity Opportunity Close Entity
status number Opportunity Status
requestId (optional) string Request unique identifier (GUID)

Properties

Name Type Description
opportunityClose COSA.BusinessEntity Opportunity Close Entity
status number Opportunity Status
requestId (optional) string Request unique identifier (GUID)

Example

var be = new COSA.BusinessEntity('opportunityclose', null, {
        'opportunityid': new COSA.EntityReference('opportunity', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
    });
var winOpportunity_0 = new COSA.Request.WinOpportunity(be, 2);

//message execution
winOpportunity_0.execute(function ( r ) {
	//working with a response
});
//or
COSA.Request.Execute(winOpportunity_0, function ( r ) {
	//working with a response
});

Back to Top

Last edited Dec 28, 2015 at 1:27 PM by sciencesoft, version 1