You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are building out an OData v4 API in NAV version 14, using what documentation we can find--much of which relates only to AL. However, this is where our client is. Specifically, we need a couple of bound actions. One of these works as described in the documentation: https://<server>/<service>/ODataV4/Company('<company>')/portalUser('520124')/NAV.SendPasswordReset
When we tried to create another bound action on another page, this one with a return value, we can see it in the $metadata but a Postman query returns { "error": { "code": "BadRequest_NotFound", "message": "The URI segment 'NAV.PrintDoc' is invalid after the segment 'purchHeader('PI10095')'." } }
Here is the query: https://<server>/<service>/ODataV4/Company('<company>')/purchHeader('PI10095')/NAV.PrintDoc
We find that bound action procedures with return values cannot be accessed, whereas bound action procedures without return values work sometimes. We cannot seem to find what is the controlling factor. Nor can we find anything beyond the most basic documentation for this functionality, so we are flying blind.
Microsoft Support sent us to this forum, having been unable to find any resource that could explain this functionality in this version. In hopes that someone with experience with the OData v4 interface in version 14 NAV might turn up. Many thanks and apologies for having to post this on a BC repo.
The text was updated successfully, but these errors were encountered:
I'm relatively new to AL but I was trying to debug a similar issue myself, it turns out I needed to move ActionContext: WebServiceActionContext out of the procedure parameters. For example:
[ServiceEnabled]
[Scope('Cloud')]
procedure ShipOnly(ActionContext: WebServiceActionContext): Text
var
SalesHeader: Record "Sales Header";
SalesShipmentHeader: Record "Sales Shipment Header";
begin
...
exit(SomeText);
end;
becomes
[ServiceEnabled]
[Scope('Cloud')]
procedure ShipOnly(): Text
var
ActionContext: WebServiceActionContext;
SalesHeader: Record "Sales Header";
SalesShipmentHeader: Record "Sales Shipment Header";
begin
...
exit(SomeText);
end;
We are building out an OData v4 API in NAV version 14, using what documentation we can find--much of which relates only to AL. However, this is where our client is. Specifically, we need a couple of bound actions. One of these works as described in the documentation:
https://<server>/<service>/ODataV4/Company('<company>')/portalUser('520124')/NAV.SendPasswordReset
When we tried to create another bound action on another page, this one with a return value, we can see it in the $metadata but a Postman query returns
{ "error": { "code": "BadRequest_NotFound", "message": "The URI segment 'NAV.PrintDoc' is invalid after the segment 'purchHeader('PI10095')'." } }
Here is the query:
https://<server>/<service>/ODataV4/Company('<company>')/purchHeader('PI10095')/NAV.PrintDoc
We find that bound action procedures with return values cannot be accessed, whereas bound action procedures without return values work sometimes. We cannot seem to find what is the controlling factor. Nor can we find anything beyond the most basic documentation for this functionality, so we are flying blind.
Microsoft Support sent us to this forum, having been unable to find any resource that could explain this functionality in this version. In hopes that someone with experience with the OData v4 interface in version 14 NAV might turn up. Many thanks and apologies for having to post this on a BC repo.
The text was updated successfully, but these errors were encountered: