Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Customization to Automate Workflow Deployment to Many Legal Entities

(4) ShareShare
ReportReport
Posted on by 18
Howdy all, I am trying to facilitate a customization that will allow us to in mass copy and deploy non-org wide workflows to other legal entities.
 
The approach I have been attempting is to pull their schema via Microsoft.Dynamics.AX.Framework.Workflow.Model.WorkflowModel::ExportToStream class/method to get the stream object. I have been able to call this without issue.
 
Then I am reading the stream and finding and replacing a few specific values, then saving the updated stream and then try to import elsewhere. The Microsoft.Dynamics.AX.Framework.Workflow.Model.WorkflowModel object is not something I can look at or debug from VS. I can only see this object in the kernel of the application as a DLL in the bin directory. This object has an import, loadexportedworkflowfromdisk and loadexportedworkflowfromstream methods, however when I try to call them even if I specify the correct inputs I get an error stating the method can't be found. It seems like MS may have locked us out from using certain methods on this object but I can't tell how or why.
 
Does anyone have experience with this topic or specifically this object in D365 and provide any trials and tribulations to share? I found a couple of old posts where people posted about a similiar issue where if you have hundreds of legal entities there is not a scalable way to support non-org wide workflows. Hopefully someone can help point me in the right direction on how to leverage this object for my use case or point me to a technique that would facilitate the request.
 
 
Categories:
  • NICKDOG Profile Picture
    18 on at
    Customization to Automate Workflow Deployment to Many Legal Entities
    Andres is correct in that in my implementation of D365 finance we have almost 200 legal entities and growing. To export workflows and import them for a revision update as an example is very manual labor intensive and poses consistency risk.
     
    We are trying to automate this process given our workflows normally don't deviate between legal entities in terms of their logic and approvers.
     
    I can export all active workflows from a legal entity, edit them to have the target LE, sequence number and version id. But when I try to load them programmatically via any of the methods on the class I reference it fails for various reasons. If I could see the
    Microsoft.Dynamics.AX.Framework.Workflow.Model.WorkflowModel code or better yet debug, I could hopefully figure out why I'm unable to load the workflows.
     
     
     
     
  • André Arnaud de Calavon Profile Picture
    293,025 Super User 2025 Season 1 on at
    Customization to Automate Workflow Deployment to Many Legal Entities
    Hi NickDog,

    I was involved in an implementation having over 2500 legal entities with the same requirement. This was AX2012 and not Dynamics 365. 
    In case you now got an error when trying to call methods from the Workflow model, did you actually reference that model in your own custom model?
     
    @Adis, Copying the workflow configuration is possible using export and import files, but when there are hundreds of legal entities, you don't want to do this manually. That would take weeks and an user can make a mistake or by accident skip a company.
  • Adis Profile Picture
    3,034 Super User 2025 Season 1 on at
    Customization to Automate Workflow Deployment to Many Legal Entities
    Hello,
     
    Can you tell us a bit why you need a customization for this, when you can export and import Workflows?
    I am trying to understand the business case.
     
    Kind regards, Adis

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,025 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans