All docs This doc
||
Skip to end of metadata
Go to start of metadata


Overview

The following operations allow you to work with delete entities. Click an operation to see details on how to use it.

OperationDescription
deleteEntityDelete an entity using Web API.
deleteSinglePropertyValueTo delete the value of a single property of an entity.

For a sample proxy service that illustrates how to work with delete entities, see Sample configuration.

Operation details

This section provides details on the operations.

Delete an Entity

To delete an entity using the Web API, use msdynamics365.deleteEntity.

deleteEntity
<msdynamics365.deleteEntity>
    <entityType>{$ctx:entityType}</entityType>
    <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue>
</msdynamics365.deleteEntity>
Properties
  • <entityType>: Mandatory. The type of an entity (i.e accounts, opportunities, contacts etc).
  • <primaryKeyValue>: Mandatory. The primary key value of an entity.
Sample request

Following is a sample REST/JSON request that can be handled by the deleteEntity operation.

Sample Request for Delete Entity
{       
       "apiUrl":"https://wso2.crm5.dynamics.com",
       "accessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3",
       "refreshToken":"AQABAAAAAABnfiG-mA6NTae7CdWW7Qfd0aAk9Jh2jERSJt61ivkdC_8VpI4B75AWvtviJErRhnzKIDvt",
       "clientSecret":"iDJ7gQ81N+JAW9Ql2/ikMzc9og",
       "clientId":"c12ec5be-8356-ed0915a",
       "resource":"https://wso21234.crm5.dynamics.com/",
       "registryPath":"",
       "intervalTime":"",
       "entityType":"accounts",
       "primaryKeyValue":"00000000-0000-0000-0000-000000000001"
}

Delete a single property value

To delete the value of a single property of an entity, use msdynamics365.deleteSinglePropertyValue.

deleteSinglePropertyValue
<msdynamics365.deleteSinglePropertyValue>
    <entityType>{$ctx:entityType}</entityType>
    <singlePropertyName>{$ctx:singlePropertyName}</singlePropertyName>
    <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue>
</msdynamics365.deleteSinglePropertyValue>
Properties
  • <entityType>: Mandatory. The type of an entity (i.e accounts, opportunities, contacts etc).
  • <singlePropertyName>: Mandatory. The name of the property that you want to delete.
  • <primaryKeyValue>: Mandatory. The primary key value of an entity.
Sample request

Following is a sample REST/JSON request that can be handled by the deleteSinglePropertyValue operation.

Sample Request for Delete Single Property Value
{    
           	"apiUrl":"https://wso2.crm5.dynamics.com",
           	"accessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3",
           	"refreshToken":"AQABAAAAAABnfiG-mA6NTae7CdWW7Qfd0aAk9Jh2jERSJt61ivkdC_8VpI4B75AWvtviJErRhnzKIDvt",
           	"clientSecret":"iDJ7gQ81N+JAW9Ql2/ikMzc9og",
           	"clientId":"c12ec5be-8356-ed0915a",
           	"resource":"https://wso21234.crm5.dynamics.com/",
           	"registryPath":"",
           	"intervalTime":"",
           	"entityType":"accounts",
           	"primaryKeyValue":"00000000-0000-0000-0000-000000000001",
    		"singlePropertyName":"name"
}

For more information on deleting a Single Property Value, see https://msdn.microsoft.com/en-us/library/mt607664.aspx#bkmk_deleteSingleProperty.

Sample configuration

Given below is a sample proxy service that illustrates how to connect to Microsoft Dynamics 365 with the init operation and use the deleteEntity operation. To view the sample request for this proxy, see Sample Request for the deleteEntity operation. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="msdynamics_deleteEntity"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
           	<property expression="json-eval($.apiUrl)" name="apiUrl"/>
			<property expression="json-eval($.accessToken)" name="accessToken"/>
			<property expression="json-eval($.entityType)" name="entityType"/>
			<property expression="json-eval($.primaryKeyValue)" name="primaryKeyValue"/>
			<property expression="json-eval($.apiVersion)" name="apiVersion"/>
			<property expression="json-eval($.refreshToken)" name="refreshToken"/>
			<property expression="json-eval($.clientSecret)" name="clientSecret"/>
			<property expression="json-eval($.clientId)" name="clientId"/>
			<property expression="json-eval($.resource)" name="resource"/>
			<property expression="json-eval($.registryPath)" name="registryPath"/>
			<property expression="json-eval($.intervalTime)" name="intervalTime"/>
           	<msdynamics365.init>
    			<apiUrl>{$ctx:apiUrl}</apiUrl>
    			<accessToken>{$ctx:accessToken}</accessToken>
    			<apiVersion>{$ctx:apiVersion}</apiVersion>
    			<refreshToken>{$ctx:refreshToken}</refreshToken>
    			<clientSecret>{$ctx:clientSecret}</clientSecret>
    			<clientId>{$ctx:clientId}</clientId>
    			<resource>{$ctx:resource}</resource>
    			<registryPath>{$ctx:registryPath}</registryPath>
    			<intervalTime>{$ctx:intervalTime}</intervalTime>
			</msdynamics365.init>
            <msdynamics365.deleteEntity>
    			<entityType>{$ctx:entityType}</entityType>
    			<primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue>
			</msdynamics365.deleteEntity>
            <respond/>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>                          
  • No labels