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, ...
Answered

Calling sequence Custom service

(0) ShareShare
ReportReport
Posted on by 230

Hi team,

 

Request Contract Class: Receives input from the external system, such as the customer account number.

 


Service Class: Contains the X++ business logic. It reads the request, retrieves the required information, and prepares the response.

 


Response Contract Class: Holds the output, such as the customer name, credit limit, and associated sales orders.

 

Service Group is also required to expose the custom service through the D365FO service endpoint.

 

Is it correct sequence of calling Custom service?

 

Pls advise, thanks 

Categories:
  • Verified answer
    Layan Jwei Profile Picture
    8,428 Super User 2026 Season 2 on at

    Hi @CU29091230-0 
     

    Correct.

    The service class retrieves or processes the information

     

    you will need service group and service

    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
    CU-1234529-002 Profile Picture
    631 on at

    Hi,

    As Layan said, your understanding is correct. To make the sequence clearer, there are two parts.

    Building blocks in D365FO:

    1. Request contract class, with the input such as the customer account (DataContract and DataMember attributes).

    2. Response contract class, with the output such as the name, credit limit and orders.

    3. Service class, with the operation method that takes the request contract and returns the response contract.

    4. A Service object in the AOT that points to the service class and its operation.

    5. A Service group that contains that service, which is what exposes it at the endpoint.

    Runtime call sequence:

    1. The external system gets an OAuth token from Microsoft Entra ID (the app registration must be set up for D365FO).

    2. It sends a POST to https://<environment>/api/services/<ServiceGroup>/<Service>/<Operation> with the request contract as JSON.

    3. D365FO runs the service operation, which reads the data and fills the response contract.

    4. The response contract is returned to the caller as JSON.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

#3
Aayush Tiwari Profile Picture

Aayush Tiwari 222

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans