I’ve promised this post to some attendees of my last Dynamics 365 Business Central development workshop in Microsoft Italy (c/o Microsoft House) last week. Question was: How can I call Dynamics 365 Business Central logic from an external application? Simple answer given by all: you can publish a codeunit as web service and use the SOAP endpoint. But if I want to use OData? You cannot publish a codeunit as an OData endpoint. Answer: you can call custom Dynamics 365 Business Central functions via ODataV4 by using Bound Actions . Bound Actions are actions related to an entity that you can call via an HTTP call and they can invoke your business logic (functions). Unfortunately, documentation about how to use OData V4 bound actions with Dynamics 365 Business Central is quite poor and with this post I would like to help clearing this topic a bit more. There are two main scenarios that I want to cover here: Calling a D365BC codeunit that performs business logic, like creating new entities Calling a procedure in a D365BC codeunit by passing parameters and reading a return value For this sample I’ve decided to create an extension with a codeunit that contains the business logic that I want to call via OData. My codeunit has two business functions: CloneCustomer : it creates a new customer based on an existing customer record GetSalesAmount : it gives the total sales amount for a given customer The codeunit code is defined as follows: To use OData V4 bound actions you need to declare a function in a page and this function must have the [ServiceEnabled] attribute. For this demo project, I would like to publish the Customer Card (page 21) as OData web service, so the natural thing to do is to create a pageextension object of the Customer Card to add our [ServiceEnabled] procedure and then publishing the Customer Card as web service. If you try to do this, it will never work! If you declare a [ServiceEnabled] function in a pageextension object and you try to reach the metadata of the OData endpoint ( baseurl/ODataV4/$metadata ), you will not see the action published. To publish your action attached to the Customer entity, you need to create a new page like the following and then publishing it as web service: Here, ODataKeyFields property specify what is the field to use as key when calling the OData endpoint (I want the “No.” field of the Customer record). Inside this page, I declare two procedures to call the two methods defined above in our AL codeunit: Here: CloneCustomer is a procedure called without parameters. It takes the context of the call and calls the CloneCustomer method defined in our codeunit. GetSalesAmount is a procedure that takes a Code parameter, calls the GetSalesAmount procedure defined in our codeunit and returns the result as response. What happens with the following definitions when we publish the MyCustomerCard page as web service (here called MyCustomerCardWS )? If we reach the OData V4 metadata, we can see that now we have the actions published: Now we can try to call our bound actions via OData. As a first step, we want to call the CloneCustomer function. For this, we need to send a POST request to the following endpoint: https://yourbaseurl/ODataV4/Company('CRONUS%20IT')/MyCustomerCardWS('10000')/NAV.CloneCustomer I’m using the REST Client extension to send HTTP requests to the above endpoint. This is the request sent: and this is the result of this call: What happens on Dynamics 365 Business Central? The code in our codeunit is called and we have a Customer record created (cloned by the customer with “No.” = 10000 as the input): Our second function to call ( GetSalesAmount ) wants a Code[20] parameter as input (not needed but it’s only to show hot to pass parameters to a bound action). We need to send a POST request to the following endpoint: https://yourbaseurl/ODataV4/Company('CRONUS%20IT')/MyCustomerCardWS('10000')/NAV.GetSalesAmount by passing a JSON body with the parameters (name and value). This is the request sent: and this is the response: We have the value of the total sales amount for the given customer (retrieved by calling our codeunit method). Here there’s a point to remember, because it was for me a source of hours spent on debugging: parameter’s name to pass on the JSON object must match with the OData metadata, not with your function’s parameters. For example, if you declare the bound action as follows: where CustomerNo parameter has capital letters, the OData metadata is as follows: so the JSON must be passed accordingly (parameters names must match). Not so easy, but very powerful when you understand the logic
↧
Blog Post: Dynamics 365 Business Central: using OData V4 Bound Actions
↧
Forum Post: Send to excel button on nav 2013, is disabled, i can see it, but cant push it.
On a workstation, we install NAV 2013, but when try to push button send to Excel, is not available, It has a lighter color. We have office 2019, is this the problem?
↧
↧
Forum Post: RE: Permissions to view Qty on purch order
That worked! I did end up copying the permission set and only giving them read permission on all of them, because I don't want them to be able to add any purchase or sales orders. Thank you so much for your help!
↧
Forum Post: RE: Permissions to view Qty on purch order
Now your really understanding the permission structure in NAV! That's awesome!
↧
Forum Post: RE: How to iterate over JSON array in Navison 2018 using C/AL
Thank for the Reply. It's works perfectly.
↧
↧
Forum Post: RE: How to iterate over JSON array in Navison 2018 using C/AL
thanks
↧
Forum Post: How to customise a Multilevel approvals workflow in Navision 2018.
Hi, All I want to create a customize Multilevel approvals workflow in NAV 2018. I am having one Page In that Page there is One Option status Field [ie. Draft, Pending for approval and Release]. the business requirement is that If "A" user sends Request then the status field on Page is changed "Draft" into "Pending Approval" as well as Request send "B" user. when "B" user has Approved the request. after that, this request is sent to the "C" User. After Final User is Approve the request then status on Page in changed "Pending Approval" into "Release". "B" and "C" user is Added in Workflow user group with Sequence. Thanks in Advance.
↧
Forum Post: 논산출장샵→24시출장안마【 카톡Kn 39 】논산출장샵→논산모텔출장→논산출장마사지→논산콜걸→논산최고서비스→논산출장업소
논산출장샵→24시출장안마【 카톡Kn 39 】논산출장샵→논산모텔출장→논산출장마사지→논산콜걸→논산최고서비스→논산출장업소 논산출장샵→24시출장안마【 카톡Kn 39 】논산출장샵→논산모텔출장→논산출장마사지→논산콜걸→논산최고서비스→논산출장업소 논산출장샵→24시출장안마【 카톡Kn 39 】논산출장샵→논산모텔출장→논산출장마사지→논산콜걸→논산최고서비스→논산출장업소
↧
Forum Post: 보성출장샵 -24시출장안마 카톡y876 보성출장마사지 보성출장안마 보성출장안마코스 보성출장안마 #O# 보성출장맛사지 보성출장맛사지
보성출장샵 -24시출장안마 카톡y876 보성출장마사지 보성출장안마 보성출장안마코스 보성출장안마 #O# 보성출장맛사지 보성출장맛사지 보성출장샵 -24시출장안마 카톡y876 보성출장마사지 보성출장안마 보성출장안마코스 보성출장안마 #O# 보성출장맛사지 보성출장맛사지 보성출장샵 -24시출장안마 카톡y876 보성출장마사지 보성출장안마 보성출장안마코스 보성출장안마 #O# 보성출장맛사지 보성출장맛사지
↧
↧
Forum Post: 대구출장샵→24시출장안마【 카톡Kn 39 】대구출장샵→대구모텔출장→대구출장마사지→대구콜걸→대구최고서비스→대구출장업소
대구출장샵→24시출장안마【 카톡Kn 39 】대구출장샵→대구모텔출장→대구출장마사지→대구콜걸→대구최고서비스→대구출장업소 대구출장샵→24시출장안마【 카톡Kn 39 】대구출장샵→대구모텔출장→대구출장마사지→대구콜걸→대구최고서비스→대구출장업소 대구출장샵→24시출장안마【 카톡Kn 39 】대구출장샵→대구모텔출장→대구출장마사지→대구콜걸→대구최고서비스→대구출장업소
↧
Forum Post: 양산출장샵→24시출장안마【 카톡Kn 39 】양산출장샵→양산모텔출장→양산출장마사지→양산콜걸→양산최고서비스→양산출장업소
양산출장샵→24시출장안마【 카톡Kn 39 】양산출장샵→양산모텔출장→양산출장마사지→양산콜걸→양산최고서비스→양산출장업소 양산출장샵→24시출장안마【 카톡Kn 39 】양산출장샵→양산모텔출장→양산출장마사지→양산콜걸→양산최고서비스→양산출장업소 양산출장샵→24시출장안마【 카톡Kn 39 】양산출장샵→양산모텔출장→양산출장마사지→양산콜걸→양산최고서비스→양산출장업소
↧
Forum Post: 서울출장샵 -24시출장안마 카톡y876 서울출장마사지 서울출장안마 서울출장안마코스 서울출장안마 #P# 서울출장맛사지 서울출장맛사지
서울출장샵 -24시출장안마 카톡y876 서울출장마사지 서울출장안마 서울출장안마코스 서울출장안마 #P# 서울출장맛사지 서울출장맛사지 서울출장샵 -24시출장안마 카톡y876 서울출장마사지 서울출장안마 서울출장안마코스 서울출장안마 #P# 서울출장맛사지 서울출장맛사지 서울출장샵 -24시출장안마 카톡y876 서울출장마사지 서울출장안마 서울출장안마코스 서울출장안마 #P# 서울출장맛사지 서울출장맛사지 서울출장샵 -24시출장안마 카톡y876 서울출장마사지 서울출장안마 서울출장안마코스 서울출장안마 #P# 서울출장맛사지 서울출장맛사지
↧
Forum Post: 완주출장샵→24시출장안마【 카톡Kn 39 】완주출장샵→완주모텔출장→완주출장마사지→완주콜걸→완주최고서비스→완주출장업소
완주출장샵→24시출장안마【 카톡Kn 39 】완주출장샵→완주모텔출장→완주출장마사지→완주콜걸→완주최고서비스→완주출장업소 완주출장샵→24시출장안마【 카톡Kn 39 】완주출장샵→완주모텔출장→완주출장마사지→완주콜걸→완주최고서비스→완주출장업소
↧
↧
Forum Post: 강릉출장샵→24시출장안마【 카톡Kn 39 】강릉출장샵→강릉모텔출장→강릉출장마사지→강릉콜걸→강릉최고서비스→강릉출장업소
강릉출장샵→24시출장안마【 카톡Kn 39 】강릉출장샵→강릉모텔출장→강릉출장마사지→강릉콜걸→강릉최고서비스→강릉출장업소 강릉출장샵→24시출장안마【 카톡Kn 39 】강릉출장샵→강릉모텔출장→강릉출장마사지→강릉콜걸→강릉최고서비스→강릉출장업소 강릉출장샵→24시출장안마【 카톡Kn 39 】강릉출장샵→강릉모텔출장→강릉출장마사지→강릉콜걸→강릉최고서비스→강릉출장업소
↧
Forum Post: 경기출장샵 -24시출장안마 카톡y876 경기출장마사지 경기출장안마 경기출장안마코스 경기출장안마 #Q# 경기출장맛사지 경기출장맛사지
경기출장샵 -24시출장안마 카톡y876 경기출장마사지 경기출장안마 경기출장안마코스 경기출장안마 #Q# 경기출장맛사지 경기출장맛사지 경기출장샵 -24시출장안마 카톡y876 경기출장마사지 경기출장안마 경기출장안마코스 경기출장안마 #Q# 경기출장맛사지 경기출장맛사지 경기출장샵 -24시출장안마 카톡y876 경기출장마사지 경기출장안마 경기출장안마코스 경기출장안마 #Q# 경기출장맛사지 경기출장맛사지
↧
Forum Post: 예천출장샵→24시출장안마【 카톡Kn 39 】예천출장샵→예천모텔출장→예천출장마사지→예천콜걸→예천최고서비스→예천출장업소
예천출장샵→24시출장안마【 카톡Kn 39 】예천출장샵→예천모텔출장→예천출장마사지→예천콜걸→예천최고서비스→예천출장업소 예천출장샵→24시출장안마【 카톡Kn 39 】예천출장샵→예천모텔출장→예천출장마사지→예천콜걸→예천최고서비스→예천출장업소 예천출장샵→24시출장안마【 카톡Kn 39 】예천출장샵→예천모텔출장→예천출장마사지→예천콜걸→예천최고서비스→예천출장업소
↧
Forum Post: 울산출장샵 -24시출장안마 카톡y876 울산출장마사지 울산출장안마 울산출장안마코스 울산출장안마 #P# 울산출장맛사지 울산출장맛사지
울산출장샵 -24시출장안마 카톡y876 울산출장마사지 울산출장안마 울산출장안마코스 울산출장안마 #P# 울산출장맛사지 울산출장맛사지 울산출장샵 -24시출장안마 카톡y876 울산출장마사지 울산출장안마 울산출장안마코스 울산출장안마 #P# 울산출장맛사지 울산출장맛사지 울산출장샵 -24시출장안마 카톡y876 울산출장마사지 울산출장안마 울산출장안마코스 울산출장안마 #P# 울산출장맛사지 울산출장맛사지 울산출장샵 -24시출장안마 카톡y876 울산출장마사지 울산출장안마 울산출장안마코스 울산출장안마 #P# 울산출장맛사지 울산출장맛사지
↧
↧
Forum Post: 증평출장샵→24시출장안마【 카톡Kn 39 】증평출장샵→증평모텔출장→증평출장마사지→증평콜걸→증평최고서비스→증평출장업소
증평출장샵→24시출장안마【 카톡Kn 39 】증평출장샵→증평모텔출장→증평출장마사지→증평콜걸→증평최고서비스→증평출장업소 증평출장샵→24시출장안마【 카톡Kn 39 】증평출장샵→증평모텔출장→증평출장마사지→증평콜걸→증평최고서비스→증평출장업소 증평출장샵→24시출장안마【 카톡Kn 39 】증평출장샵→증평모텔출장→증평출장마사지→증평콜걸→증평최고서비스→증평출장업소
↧
Forum Post: 부여출장샵→24시출장안마【 카톡Kn 39 】부여출장샵→부여모텔출장→부여출장마사지→부여콜걸→부여최고서비스→부여출장업소
부여출장샵→24시출장안마【 카톡Kn 39 】부여출장샵→부여모텔출장→부여출장마사지→부여콜걸→부여최고서비스→부여출장업소 부여출장샵→24시출장안마【 카톡Kn 39 】부여출장샵→부여모텔출장→부여출장마사지→부여콜걸→부여최고서비스→부여출장업소 부여출장샵→24시출장안마【 카톡Kn 39 】부여출장샵→부여모텔출장→부여출장마사지→부여콜걸→부여최고서비스→부여출장업소
↧
Forum Post: 의왕출장샵→24시출장안마【 카톡Kn 39 】의왕출장샵→의왕모텔출장→의왕출장마사지→의왕콜걸→의왕최고서비스→의왕출장업소
의왕출장샵→24시출장안마【 카톡Kn 39 】의왕출장샵→의왕모텔출장→의왕출장마사지→의왕콜걸→의왕최고서비스→의왕출장업소 의왕출장샵→24시출장안마【 카톡Kn 39 】의왕출장샵→의왕모텔출장→의왕출장마사지→의왕콜걸→의왕최고서비스→의왕출장업소 의왕출장샵→24시출장안마【 카톡Kn 39 】의왕출장샵→의왕모텔출장→의왕출장마사지→의왕콜걸→의왕최고서비스→의왕출장업소
↧