i want to retrieve custom view ,with fetchxml or query expression in crm plugin with c#
bellow is my code :
var fetchXml =
@"<fetch>
<entity name='invoice'>
<attribute name='customerid' />
<filter type='and'>
<condition attribute='customerid' operator='eq' value='{0}' />
<condition attribute='brd_noncheckout' operator='eq' value='1' />
<condition attribute='statecode' operator='eq' value='0' />
<condition attribute='statuscode' operator='in'>
<value>100000002</value >
<value >4</value >
</condition>
</filter>
</entity>
</fetch>";
CurrentPosition = 33.1;
var request = new RetrieveMultipleRequest()
{
Query = new FetchExpression(string.Format(fetchXml, currentCustomerRef.Id, DateTime .Now ))
};
CurrentPosition = 33.2;
var requestResponse = (RetrieveMultipleResponse)service.Execute(request);
CurrentPosition = 33.3;
//+++++++++++++++++++++++++++++++++++++++++++++++
if (requestResponse.EntityCollection != null)
{
var retOrders = requestResponse.EntityCollection;
CurrentPosition = 33.4;
CurrentPosition = 33.4;
if (retOrders.Entities.Count > 0)
throw new InvalidPluginExecutionException(OperationStatus.Canceled,
"special message.");
}
}
but this code retrieve dada from all invoice view, i creat a custom view thats name is "custom view"
i want my fetchxml code , execute on "custom view" not in "all invoice"
*This post is locked for comments