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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Set Entity Value C#

(0) ShareShare
ReportReport
Posted on by 85

Hi,

We have accounts, which has many contacts, for every contact we have a flag.

Can we set each flag to FALSE without iterating each contact in the account ?

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi,

    You can create on-demand workflow to set your flag to FALSE. Then use Bulk Worflow execution tool availble on XrmToolBox to execute your workflow against your contacts. Bulk Workflow execution offer the possibility to use views and fetchXml.

    Please check this blog for more details about the tool:

    www.powerobjects.com/.../

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I'm afraid you can't.

    Can you please tell more about your scenario - may there there is an alternative way to implement your requirement.

  • RG Student Profile Picture
    85 on at

    Thank You Mehdi El Amri .

    As suggested I have created a workflow, now, how can I get the contacts associated with the given account and set the flag for each contact?

  • RG Student Profile Picture
    85 on at

    Hi Andrew,

    We have multiple contacts associated with an Acoount. For each Contact there is a flag xyz.

    so, for each contact I need to set the flag as FALSE for a given condition.

    Could you please suggest how I can do this using C# ?

    Thanks.

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi, 

    You should use bulk workflow execution and use a fetchXml query to execute the workflow against the associated contacts

  • Suggested answer
    TNS Profile Picture
    1,197 on at

    Hi,

    you can create custom workflow and run as on demand workflow. In your custom workflow you can get the account and by using your account id  you can retrieve its contact based on condition by "Query Expression" or "Fetch XML" which suits you. Then you can change the flag.

    After creating your workflow select the accounts and run workflow.

    Regards,

    TNS

  • Suggested answer
    Bipin D365 Profile Picture
    28,995 Moderator on at

    Hi,

    You can use microsoft flow to achieve your requirement. But you will have to iterate contact records associated to account.

    You can get all contacts associated to Account using Web api filter criteria in microsoft flow.

    If you want to go with c# code then you can use query expression or fetchxml to get all contacts associated to account. Use company name field on Contact to get all contacts associated to a particular account.

    If found helpful, Please mark my answer verified.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 102

#2
11manish Profile Picture

11manish 88 Super User 2026 Season 2

#3
ParthPatel249 Profile Picture

ParthPatel249 84

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans