web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Need help: X++ service returns metadata, not worker data

(0) ShareShare
ReportReport
Posted on by 53

Hello everyone,

I’m currently working on a Dynamics 365 Finance & Operations (X++) project, and I’m trying to create a Custom Service (API) to display employee data from the HcmWorker table.

I’ve already created the necessary classes (EmpWorkerContract and EmpWorkerService), the service, and the service group — everything builds and deploys successfully.

However, when I test the API from Postman, instead of getting actual worker data, the response only shows the service metadata (the parameter and return type information).

Could someone please explain why this happens and how I can fix it so the API returns the actual data in JSON format?

 
 
The class code is attached : 
 
                    EmpWorkerContract
                    EmpWorkerService
 
 
 
 
 

Thank you!

I have the same question (0)
  • Layan Jwei Profile Picture
    8,040 Super User 2025 Season 2 on at
    Need help: X++ service returns metadata, not worker data
    Hi,

    How do you call the custom service via postman? can you show us the url please in addition to the body

    the url in postman should be like this:
    YourEnvironmentUrl/api/services/YourServiceGroupName/YourServiceName/YourServiceMethod

    I only know your service name and your service method, therefore you will need to replace the ones in bold with ur data
    YourEnvironmentUrl/api/services/YourServiceGroupName/EmpWorkerService/getWorkers
     

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future.

  • Layan Jwei Profile Picture
    8,040 Super User 2025 Season 2 on at
    Need help: X++ service returns metadata, not worker data
    Also please replace your method attributes with this

        [AifCollectionTypeAttribute('return', Types::Class, classStr(EmpWorkerContract))]
        public List getWorkers(int _top = 50)
        {
        }



    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future.

  • Suggested answer
    Martin Dráb Profile Picture
    236,334 Most Valuable Professional on at
    Need help: X++ service returns metadata, not worker data
    This is what you get when you send a GET request. To execute the service, use a POST request instead.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,029

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans