Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Entity collection error

$
0
0

I have done everything i can think of and dont know what else to do.

My custom workflow is falling on "Entity collection" as shown below. Any reason please ?

//Get Opportunity ID
Guid OpportunityID = this.GetOpportunity.Get(context).Id;

tracingService.Trace("Retrieve OpportunityID" + OpportunityID);

string fetchQuery = @"<fetch distinct='false' no-lock='false' mapping='logical'>
< entity name = 'opportunityproduct' >
< attribute name = 'opportunityproductid' />
< attribute name = 'opportunityproductname' />
< order descending = 'false' attribute = ''opportunityproductname' />
< filter type = 'and' >
< condition attribute = 'opportunityid' value='{zzz}' operator= 'eq' />
</ filter >
</ entity >
</ fetch >";

tracingService.Trace("Retrieved FetchXML Query");
fetchQuery = fetchQuery.Replace("zzz", OpportunityID.ToString());
tracingService.Trace("Retrieved Fetch Query Trace" + fetchQuery);

SCRIPT FAILS HERE ON ENTITY COLLECTION

EntityCollection results = service.RetrieveMultiple(new FetchExpression(fetchQuery));
tracingService.Trace("Results counted" + results.TotalRecordCount);


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images