locked
CRM SOAP Action Call - Required field 'Target' is missing RRS feed

  • Question

  • <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
    	<soap:Body>
    		<Execute xmlns='http://schemas.microsoft.com/xrm/2011/Contracts/Services' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
    			<request xmlns:a='http://schemas.microsoft.com/xrm/2011/Contracts'>
    				<a:Parameters xmlns:b='http://schemas.datacontract.org/2004/07/System.Collections.Generic'></a:Parameters>
    				<a:RequestId i:nil='true' />
    				<a:RequestName>test_action</a:RequestName>
    			</request>
    		</Execute>
    	</soap:Body>
    </soap:Envelope>

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    	<s:Body>
    		<s:Fault>
    			<faultcode>s:Client</faultcode>
    			<faultstring xml:lang="en-US">Required field 'Target' is missing</faultstring>
    			<detail>
    				<OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    					<ErrorCode>-2147220989</ErrorCode>
    					<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
    					<Message>Required field 'Target' is missing</Message>
    					<Timestamp>2017-10-16T18:40:29.8686097Z</Timestamp>
    					<InnerFault>
    						<ErrorCode>-2147220970</ErrorCode>
    						<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
    						<Message>System.ArgumentException: Required field 'Target' is missing</Message>
    						<Timestamp>2017-10-16T18:40:29.8686097Z</Timestamp>
    						<InnerFault i:nil="true"/>
    						<TraceText i:nil="true"/>
    					</InnerFault>
    					<TraceText i:nil="true"/>
    				</OrganizationServiceFault>
    			</detail>
    		</s:Fault>
    	</s:Body>
    </s:Envelope>

    I'm trying to call an action with no parameters and getting 'Required field 'Target' is missing' error.

    Monday, October 16, 2017 6:46 PM

All replies

  • I've added the target and the first issue is resolved.

    Now I'm getting the following error,

    There is no active transaction. This error is usually caused by custom plug-ins that ignore errors from service calls and continue processing.

    <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
    	<soap:Body>
    		<Execute xmlns='http://schemas.microsoft.com/xrm/2011/Contracts/Services' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
    			<request xmlns:a='http://schemas.microsoft.com/xrm/2011/Contracts'>
    				<a:Parameters xmlns:b='http://schemas.datacontract.org/2004/07/System.Collections.Generic'>
    					<a:KeyValuePairOfstringanyType>
    						<b:key>Target</b:key>
    						<b:value i:type='a:EntityReference'>
    							<a:Id>{E34CF60B-BBB2-E711-80E8-00155D782518}</a:Id>
    							<a:LogicalName>account</a:LogicalName>
    							<a:Name i:nil='true' />
    						</b:value>
    					</a:KeyValuePairOfstringanyType>
    				</a:Parameters>
    				<a:RequestId i:nil='true' />
    				<a:RequestName>test_action</a:RequestName>
    			</request>
    		</Execute>
    	</soap:Body>
    </soap:Envelope>

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    	<s:Body>
    		<s:Fault>
    			<faultcode>s:Client</faultcode>
    			<faultstring xml:lang="en-US">There is no active transaction. This error is usually caused by custom plug-ins that ignore errors from service calls and continue processing.</faultstring>
    			<detail>
    				<OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    					<ErrorCode>-2147220911</ErrorCode>
    					<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
    					<Message>There is no active transaction. This error is usually caused by custom plug-ins that ignore errors from service calls and continue processing.</Message>
    					<Timestamp>2017-10-16T22:18:06.7861343Z</Timestamp>
    					<InnerFault i:nil="true"/>
    					<TraceText i:nil="true"/>
    				</OrganizationServiceFault>
    			</detail>
    		</s:Fault>
    	</s:Body>
    </s:Envelope>
    In spite of the error, the action is executed as a background process and it's successful.

    Monday, October 16, 2017 10:21 PM