Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
- <entity name="account">
- <attribute name="name" />
- <attribute name="primarycontactid" />
- <attribute name="telephone1" />
- <attribute name="accountid" />
- <attribute name="address1_city" />
- <order attribute="name" descending="false" />
- <link-entity name="contact" from="parentcustomerid" to="accountid" alias="ac">
- <attribute name="address1_city" />
- </link-entity>
- </entity>
- </fetch>
- =Fields!address1_city.Value="Sydney" Or Fields!ac_address1_city.Value="Sydney"
- string fetchXml = string.Empty;
- var query = context.InputParameters["Query"] as QueryExpression;
- var fetchQuery = context.InputParameters["Query"] as FetchExpression;
- if (query == null)
- {
- if (fetchQuery == null)
- {
- return;
- }
- fetchXml = fetchQuery.Query;
- }
- // Convert query to a fetch expression for processing and apply filter
- else
- {
- fetchXml =
- ((QueryExpressionToFetchXmlResponse)
- service.Execute(new QueryExpressionToFetchXmlRequest {Query = query})).FetchXml;
- }
- if (fetchXml.Contains(OpportunityFilterGuid))
- {
- ApplyFilter(context, service, query);
- }
- }
- collectionOne.Entities.GroupBy(oppId => oppId.Id).Select(opp => opp.First())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement