Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Business Central Web Service Error resource not found for segment

(0) ShareShare
ReportReport
Posted on by

Hi, 

I created a Codeunit in AL which contains the procedure "ReleaseSalesOrder" and exposed the Codeunit through a webservice called "SoExtFuncs". I have done this with many other codeunits before but for some reason this time i continue to receive "segment not found" when trying to access this function.

The url i attempt to access the procedure through is the following:

[POST <url prefix>/sandbox/ODataV4/SoExtFuncs_ReleaseSalesOrder?company=<companyId>

The codeunit and procedure are the following:

codeunit 50154 "So Ext Func"
{

  
  var
    myInt: Integer;
    release: Codeunit "Release Sales Document";
    
    
  procedure ReleaseSalesOrder(id: Text): Record "Sales Header"
    var
      SHR: Record "Sales Header";
  begin
    SHR.GetBySystemId(id);
    release.PerformManualRelease(SHR);
    exit(SHR);
  end;
  
  }

The webservice exposed:

Screen-Shot-2022_2D00_06_2D00_15-at-10.59.34-AM.png

Error: 

Resource not found for the segment 'SoExtFuncs_ReleaseSalesOrder'.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Business Central Web Service Error resource not found for segment

    Thank you for sharing!

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Business Central Web Service Error resource not found for segment

    SOLUTION:

    unbound actions can only return type TEXT.

    Changed:

    procedure ReleaseSalesOrder(id: Text): Record "Sales Header"

    To:

    procedure ReleaseSalesOrder(id: Text): Text

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,424 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,043 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans