web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Active Discussion

Retrieve list of account in DropDownListFor

(0) ShareShare
ReportReport
Posted on by

Hi, I am developing an application using c# (asp.net) for the crm. And my problem is, I can retrieve list of account when I try create a case.
Someone can help me ? please !

*This post is locked for comments

  • Community Member Profile Picture
    on at

    Hi

    You can use fetchXml or queryexpression.

    string Fetch = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>

                   <entity name='account'>

                   <attribute name='name' />

        <attribute name='primarycontactid' />

      <attribute name='telephone1' />

        <attribute name='accountid' />

        <order attribute='name' descending='false' />

      </entity>

    </fetch>";

                   EntityCollection accountEntityCollection= Service.RetrieveMultiple(new FetchExpression(Fetch));

                   #endregion

                   if (accountEntityCollection.Entities.Count > 0)

    { int  count = accountEntityCollection.Entities.Count ; }

    Hope it helps

    Thanks

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans