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 ?
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 ?
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.
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
Hi,
You should use bulk workflow execution and use a fetchXml query to execute the workflow against the associated contacts
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.
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?
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.
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:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156