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, ...
Suggested Answer

Adding new custom personnel action d365fo using x++

(3) ShareShare
ReportReport
Posted on by 269
Hello,
Is it possible to add a new custom personnel action in d365fo?
The already existing types are workers (hiring, transfers, and terminations), positions (creating and editing) and change fixed compensation.
Can I create a new type like editing a worker?
I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at
    could you retry, rephrasing your question please. what do you mean by type ?
  • MS-29011540-0 Profile Picture
    269 on at
    @Sohaib Cheema
    Sure, 
    I mean here 
     
    Adding a fully customized personnel action for editing worker data, and to work like modify position for example.
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at
    On the surface it looks possible as this is a Base Enum , which you can extended. However you would need to look at all references for this base enum, to make sure if it needs code extended anywhere else in the system.
    Say for example if this being used in class/method with if conditions or using Switch statement , you would want to add your new element as well.
     
  • Raj Borad Profile Picture
    1,424 on at
     
    As earlier suggested by @Sohaib Cheema, you can add a new custom personal action.
    I just want to know the purpose/requirement of this custom action. If required then you also need this new action to trigger a workflow like existing ones?
     
    Thank you,
    Raj D Borad
  • MS-29011540-0 Profile Picture
    269 on at
    @Sohaib Cheema
    Yes, but no documentation to create it from scratch, i fear i miss some references and don't have the full visions for the stagging tables. forms. ...
    Anyway thanks alot
    @Raj Borad Yes, the client wants exactly the edit employee action to act as any other out-of-box actions
  • Suggested answer
    Cyrille Nembot Profile Picture
    149 on at

    The personnel actions framework is
    extensible, allowing you to create new action types like "Editing a
    Worker" beyond the standard options.

    Implementation Approach

    To create a custom personnel action type:

    1. Extend the PersonnelActionType base enum:

      x++
       
    • [ExtensionOf(enumStr(PersonnelActionType))]
      public final class MyPersonnelActionType_Extension
      {
          public const MyEditWorkerAction = 20; // Use next available number
      }
    • Create a new class that extends PersonnelAction:

      x++
       
    • class MyEditWorkerPersonnelAction extends PersonnelAction
      {
          // Implement required methods
          public PersonnelActionType actionType()
          {
              return PersonnelActionType::MyEditWorkerAction;
          }
          
          // Add other required logic
      }
    • Register your action in the PersonnelActionController class initialization:

      x++
       
    personnelActionProcessorMap.insert(PersonnelActionType::MyEditWorkerAction, 
        classStr(MyEditWorkerPersonnelAction));
  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at
    @Cyrille Nembot Don't forget Responsible AI policies, such as disclosing the use of AI and verifying the correctness of your reply.
    Unfortunately, your reply is complete AI halucination and therefore not helpful to anyone.
     
    For example, the first code snippet shows a completely wrong way of extending an enum; this approach isn't possible in F&O. The constant is also missing a data type. The second code snipper suggests extending PersonnelAction, but no such a class exists. Then you suggest using PersonnelActionController class, but it doesn't exist either...

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans