Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Unable to activate the business rule via C# SDK

(1) ShareShare
ReportReport
Posted on by 3
Hi, 
 
Am trying to clone business rules from quote entity to custom entity using C# SDK.
I have successfully clone the business rules but I couldn't able to activate the business rule using C#.
Its getting update same  definition row itself. its not creating sperate row for activate business rule so that business rule is not visible in powerapps. 
 
I have attached the code snippet below:
 
But its working fine for workflow(process). 

private void ActivateWorkflow(IOrganizationService organizationService, Guid _workflowId)
{
    var activateRequest = new SetStateRequest
    {
        EntityMoniker = new EntityReference
                    (Workflow.EntityLogicalName, _workflowId),
        State = new OptionSetValue((int)WorkflowState.Activated),
        Status = new OptionSetValue((int)workflow_statuscode.Activated)
    };
    organizationService.Execute(activateRequest);
}
  • sandeep-r Profile Picture
    4 on at
    Unable to activate the business rule via C# SDK
    Unlike workflows, Business Rules require ActivateProcessRequest (not SetStateRequest) to activate them in Dynamics 365 using C#. This creates a separate published definition row in the database, making the rule visible and active in PowerApps.
    organizationService.Execute(new ActivateProcessRequest { ProcessId = clonedBusinessRuleId });
     

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans