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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to create a Leave Request in X++ code?

(2) ShareShare
ReportReport
Posted on by 405

Hello everyone,

 

I'm facing an issue related to Leave Requests in Dynamics 365.

I have a scenario where I need to submit a Leave Request on behalf of an employee using X++ code. Normally, in the system, this action is done through the standard interface, and the request goes through a specific workflow.

 

As shown in the screenshots, I can manually create a Leave Request through the UI. However, when I investigated the backend logic, I found that the submission process relies on a class named LeaveRequestSubmitter.

Unfortunately, this class is marked as internal, which means I cannot access or use it directly in my X++ code to mimic the same behavior as the standard system process.

My question is:

Is there a supported or recommended way (or logic) to programmatically create a Leave Request for a specific worker using X++?

Thanks in advance!

Categories:
I have the same question (0)
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    Moved to Finance forum, hope you don't mind.
     
    The easy way is to use the EssLeaveRequestHeaderEntity, you can call the submit method from your X++ code.
     
    It's used for external apps to interface with the Employee Self Service functionality in HR, but nothing restricts it from being used from inside F&O.
  • Adis Profile Picture
    6,686 Super User 2026 Season 1 on at
    Hi,
     
    Just a piece of advice\recommendation. In my opinion, changing any logic or adding custom code should be avoidable, unless its a strong requirement and other solutions are not applicable. So my question is, is it possible to use Power Automate to fulfill the business case? Even if the entity required is not available, I would create either a new entity or modify an existing one.
     
    As soon as MS changes something in that process, your logic will not be considered. Any issues\bugs will be out of service in this area due to custom code.
     
    I have to admit, I am not aware of your business case, so your approach might be the best in your situation, just adding my two cents.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

     

  • Ali AbdAlNasser Profile Picture
    405 on at
     
     
    I hope you're doing well.

    I'm currently working on an X++ customization in Dynamics 365 Finance, and I'm trying to understand how to call the submit method from the EssLeaveRequestHeaderEntity.

    Could you please guide me on how this can be done, or share any resources or code examples that might help me better understand the process?

    I would really appreciate your help.
    Best regards,

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 608

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 591 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans