web
You’re offline. This is a read only version of the page.
close
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

(3) 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:
I have the same question (0)
  • Adis Profile Picture
    6,064 Super User 2025 Season 2 on at
    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
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at
    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.
  • NICKDOG Profile Picture
    18 on at
    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.
     
     
     
     

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans