Hi all,
I am looking to integrate BC online with my api
so now from BC Side, i have 2 options : API and OData.
what is the plus minus between these 2?
any recommendation which one should I use?
Thanks.
Hi @Juhl
thanks for your answer.
I just created 1 page, it works fine for OData
I tested using postman
RVB21-000005 --> Document No.
ApplyToDocument --> Page Name
ApplyInvoiceToReceipt --> Function Name
[ServiceEnabled]
procedure ApplyInvoiceToReceipt(var actionContext: WebServiceActionContext)
var
WSCodeunit: Codeunit "WS Codeunit";
begin
WSCodeunit.ApplyInvoiceToReceipt(Rec."Document No.");
actionContext.SetObjectType(ObjectType::Page);
actionContext.SetObjectId(Page::"Apply To Document");
actionContext.AddEntityKey(Rec.FieldNo("Document No."), Rec."Document No.");
actionContext.SetResultCode(WebServiceActionResultCode::Created);
end;[/s]
Answers
thanks for the reply.
I just created a page to be used as OData, and i created the button (function)
it works fine.
but once I changed the page type become API , then it's gone.
does it mean i need to separate become 2 pages?
1 for API... and 1 for BC user?
And i would always keep thoose seperate.
So one page for API and one for user interface.
thanks for your answer.
I just created 1 page, it works fine for OData
I tested using postman
RVB21-000005 --> Document No.
ApplyToDocument --> Page Name
ApplyInvoiceToReceipt --> Function Name
1. OData
https://api.businesscentral.dynamics.com/v2.0/Sandbox/ODataV4/Company('Training Company')/ApplyToDocument('RVB21-000005')/NAV.ApplyInvoiceToReceipt
--> Successful
2. API
https://api.businesscentral.dynamics.com/sandbox/api/PublisherName/PublisherGroup/v2.0/Companies(d4f3c1fa-d7cc-eb11-9f0a-000d3ac7683d)/ApplyToDocument('RVB21-000005')/NAV.ApplyInvoiceToReceipt
--> Failed
any idea whats wrong with my API?
Dont mix them.
seems like OData is more efficient.
i need to develop for both BC user and API