We can use bound actions to use RESTful APIs not only to perform CRUD operations but also to invoke standard business logic defined in the application (both custom and standard code).
Bound actions can be used in the OData V4 endpoint (as described at https://demiliani.com/2019/06/12/dynamics-365-business-central-using-odata-v4-bound-actions/) and standard Dynamics 365 Business Central APIs.
Imagine you have a codeunit (in the example described here, it's called CustomerWSManagement) that defines a business logic (a set of functions) to work on the Customer entity and you want to call some of these methods from APIs. Our codeunit has two business functions:
- CloneCustomer: This creates a new customer based on an existing customer record.
- GetSalesAmount: This gives the total sales amount for a given customer.
The CustomerWSManagement ...