Notifications
Announcements
No record found.
What is the Syntax to retrieve single and multiple records in plugin code.
*This post is locked for comments
Retrieve Multiple Example:
//Create a query expression specifying the link entity alias and the columns of the link entity that you want to return QueryExpression qe = new QueryExpression(); qe.EntityName = "account"; qe.ColumnSet = new ColumnSet(); qe.ColumnSet.Columns.Add("name"); qe.LinkEntities.Add(new LinkEntity("account", "contact", "primarycontactid", "contactid", JoinOperator.Inner)); qe.LinkEntities[0].Columns.AddColumns("firstname", "lastname"); qe.LinkEntities[0].EntityAlias = "primarycontact"; EntityCollection ec = _orgService.RetrieveMultiple(qe);
Retrieve Example:
// Retrieve the account and its name and ownerid attributes.
// Create a column set to define which attributes should be retrieved. ColumnSet attributes = new ColumnSet(new string[] { "name", "ownerid" });
Entity entityObj= _service.Retrieve('entityLogicalName', new Guid('f4a76638-458b-47b7-95a7-aca4dfbe624a'), attributes); Console.Write("retrieved, ");
If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue. CheersArpithttps://arpitmscrmhunt.blogspot.in
Thanks Sir. It is really helpful.
Hi ,
Please follow below msdn reference -
msdn.microsoft.com/.../microsoft.xrm.sdk.iorganizationservice.retrieve.aspx
msdn.microsoft.com/.../microsoft.xrm.sdk.iorganizationservice.retrievemultiple.aspx
In addition to that I will suggest you to download SDK if not done yet, you will get more sample code there. You can also msdn.microsoft.com/.../gg328300.aspx different query options
Gtrr
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2