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

Notifications

Announcements

No record found.

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 ?

I have the same question (0)
  • Suggested answer
    meelamri Profile Picture
    13,216 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,216 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,983 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans