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 :
Microsoft Dynamics AX (Archived)

Write to table after Workflow button was clicked

(0) ShareShare
ReportReport
Posted on by 836

Hello,

is there any way to write to a table once user clicked on Workflow button.

Ex: once a user click on Submit button of workflow, we need to change the value of a field on a custom table.

Best Regards,

David

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi David.

    Every button in your workflow is a physical menu-item. So just take a look at the workflow type in the AOT to find the submit menu-item, from there you can find which class is being executed. Within there you can do your updates. Typically the table's status will be set to "Submitted" from that class, but you can do any code you want. Be wary of doing this from other actions. Rather stick to the event handlers

  • Crispin John Augustine Profile Picture
    37,081 on at

    example to Jonathan's comment:

    * PurchReqWorkflow.submit() - watch the ttsblock

    Jonathan, I prefer placing the Code here, instead of the event-handler (that Event handlers are associated with approval/Task, and based on their order in the WF configuration, it may not always be the same as "Submitted". Example: Consider an Approval Eventhandler, which follows a Task.)

  • Jonathan  Halland Profile Picture
    11,310 on at

    Hi Crispin.  (my comments not directly related to original question)

    Just to clarify on the above: I personally have no problem in customizing the "submit" to set status to "submitted", however anything beyond this should be kept to the workflow Event handlers (except for very specific reasons). My reasons for this is you're never sure how the config will be done, so if you code something into the "Approve" menu-button it may be clicked once if there is an single approval, or 100 times if there are multiple steps. Furthermore you can approve without clicking the "approve" button. E.G. Using the standard MS approve via e-mail, or mobile apps using the web services. You still need to keep config in mind when coding with the EH, but its certainly a bit more standardized.

  • David Tailor Profile Picture
    836 on at

    Thank You Jonathan.

    Thanks also to Crispin for your contribution

    Regards,

    David

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans