web
You’re offline. This is a read only version of the page.
close
Skip to main content
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);
}
I have the same question (0)
  • 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

Responsible AI policies

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

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 122

#2
DAnny3211 Profile Picture

DAnny3211 101

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans