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

when we should choose a Custom service or Odata

(1) ShareShare
ReportReport
Posted on by

Hi team,

As per my recent post , i almost cleared about to implement Odata and Custom services.

 

I some time confused , which approach to choose when? Either I go for Odata or Custom services.

 

 

Pls advise, when we should choose OData and when we should choose a custom service. Pls provide me an appropriate example of each.

 

Pls advise, thanks

Categories:
  • Martin Dráb Profile Picture
    241,515 Most Valuable Professional on at

    Please explain what you mean by OData. CRUD operations on data entities? OData actions? Data management package API, which is an OData service too?

  • Suggested answer
    Assisted by AI
    CU-1234529-002 Profile Picture
    618 on at

    Hi, good question. Simple rule of thumb

    Use OData when  you need standard CRUD operations (read, create, update, delete) on existing D365FO entities. Example: external system reads customer list, creates a sales order, or updates an item price. No custom logic needed, just data in/out.

    Use Custom Service when  you need complex business logic, multiple operations in one call, or the data doesn't map cleanly to a single entity. Example: external system sends an order, and D365FO needs to validate stock, calculate price, apply trade agreements and confirm all in one API call. OData can't handle that cleanly.

    In most cases OData is enough  only go for custom service when OData's standard entity methods can't cover the requirement. Thanks, 

  • Martin Dráb Profile Picture
    241,515 Most Valuable Professional on at

    As usual, the answer by @CU-1234529-002 is completely wrong. It ignores the fact that you may have business logic in data entities, it forgot OData actions etc. It claims that you can't call complex business logic via OData, but you surely can, both by data entities and OData actions.

  • André Arnaud de Calavon Profile Picture
    307,889 Super User 2026 Season 2 on at

    Hi,
    You can read more about all possible integration patterns and examples on this page: Integration between finance and operations apps and third-party services - Finance & Operations | Dynamics 365 | Microsoft Learn 

    Some additional thoughts… With OData you are bound to one main table. There can be some related records included to retrieve field values from other tables. With a custom service, you can implement multiple methods that can be called. You can have a look at e.g. the service for timesheets (TsTimesheetService). This service has methods implemented to interact with e.g. timesheet periods, resources, timesheet headers and lines. It also has some validation logic.

    With OData you can add computed columns and actions, but limited to one main source table. A service can provide a list of related methods and actions in one service.

  • Martin Dráb Profile Picture
    241,515 Most Valuable Professional on at

    @André Arnaud de Cal... You seems to be talking only about CRUD operations with data entities, but OData actions give you all the features of custom services.

  • André Arnaud de Calavon Profile Picture
    307,889 Super User 2026 Season 2 on at

    @Martin Dráb , I mentioned actions in my reply, next to computed columns. You might have overlooked this?

  • Martin Dráb Profile Picture
    241,515 Most Valuable Professional on at

    @André Arnaud de Cal... Okay, you're saying that all F&O services based OData protocol, including OData actions, are limited to one main source table and you must use custom services if you want something else.

     

    I disagree with that. OData actions can call any arbitrary logic, as custom services do. They aren't limited to a single table or anything like that.

     

    For example, look at SystemNotificationDataEntity::getInstalledModules():

     

    /// <summary>
    /// Gets all installed modules with version
    /// </summary>
    /// <returns>List of installed modules with version</returns>
    [
        SysODataActionAttribute("GetInstalledModules", false),
        SysODataCollectionAttribute("return", Types::String)
    ]
    public static List getInstalledModules()
    { … }

     

    Saying that this static method is limited to a single main table doesn't make sense to me. It's not related related to tables at all.

     

    Another example of an OData service not limited to a single main table is the package API. While an entity has a single root table, you may have a large number of entities in a single data management project (that you export or import through the API).

  • André Arnaud de Calavon Profile Picture
    307,889 Super User 2026 Season 2 on at

    @Martin Dráb, This is absolutely not what I intended to say. My intention was to mention that in one service, you can add several methods independent of the root table. E.g. get a list of timesheet periods, a list of resources for your delegates, a list of timesheets, and methods to manage the CRUD actions on timesheet details (header, lines, and other related tables). Yes, you can add some methods for the lookup of e.g. timesheet periods in a data entity using an action method and you can save data in another table. I think you will agree that you shouldn't try manage CRUD actions on timesheet headers, timesheet lines, manage favorites, timesheet comments all in one data entity. In this case, I recommend multiple data entities or expose one single service.

  • Martin Dráb Profile Picture
    241,515 Most Valuable Professional on at

    @André Arnaud de Cal... I do agree that we shouldn't do CRUD operations on many related tables in a single entity, but that's not the topic. The topic of this thread is when we should choose a Custom service or Odata. It doesn't have about CRUD operations at all.

     

    I corrected your statements that “With OData you are bound to one main table”, which is true only in some cases (using the /data/ endpoint to make CRUD operations on data entities, not other uses of OData protocol) and “With OData you can add […] actions, but limited to one main source table”, which isn't true, especially for static actions, as I demonstrated with standard code that not only isn't limited to a single main table, but it's not related to any table at all.

     

    You can call any arbitrary logic by both custom services and OData actions. Whether you use a custom service or an OData action is a design choice, not something driven by limitation of the OData protocol or the implementation of OData services in F&O. Preferring OData actions has its benefits, such as having them exposed in Dataverse by virtual entities.

     

    To give another example from the standard application, we have two similar APIs for data management. One implemented as a custom service (DMFService), another as an OData service (DataManagementDefinitionGroupEntity). It could be done differently, e.g. OData actions like GetAzureWriteUrl() could have been custom services. As I said, it's a design choice to make. You may think that Microsoft should have used custom services in this case (rather then adding actions to an entity) and we could argue about it (I don't want), but it's clear that OData actions can be used this way.

     

    I trust you that you know these things. I wanted to clarity for others, who would read the reply and believed that OData services “are bound to one main table” and you must use custom services for logic that isn't “bound to one main table”.

  • Suggested answer
    vishalsahijwani Profile Picture
    431 on at

    Hi @CU10121822-0 ,

     

    Odata carries a limitation of number of requests being sent to its API and moreover when the data limit crosses the size of 11 GB you can see Odata will start causing lags and delays in fetching the data so when you are talking about real time or near real time integration Odata is definitely not recommended. 

     

    Custom Service is a very good option for real time or near real time integration when you are using APIM (Azure API Management) tool to queue the requests and it will never get timed out. There is no data limit as well. 

    So long story short if you want to develop a robust integration then you should go for custom service. 

     

    Please check if this helps.

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
Martin Dráb Profile Picture

Martin Dráb 445 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
CU29091230-0 Profile Picture

CU29091230-0 192

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans