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

constructor in custom workflow activities

(0) ShareShare
ReportReport
Posted on by 2

When writing custom workflow activity, can we code the class constructor and initialize any variables? is there any parameters that CRM platform pass to the contsructor of custom workflow activity(as class inherits from codeactivity)?

I know we can pass parameters using in\out arguments but I had a query about use of constructor in custom workflow activities. Please advise.

I have the same question (0)
  • Suggested answer
    mobeenmohsin Profile Picture
    on at

    Hi,

    Hope you are doing well.

    It is not possible to use constructors in custom workflow activities and constructor is not being called each time, please see the reference document:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/workflow/workflow-extensions#add-your-code-to-the-execute-method

    Please mark this answer if you don't have any further question. Thank you.

    Best Regards,

    Mobeen Mohsin

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 107 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 92

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans