web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Register page as a web service dynamic nav ???

(0) ShareShare
ReportReport
Posted on by 782

Hi Experts:

i want to register a page as web service from cal i have a custom page i want to publish it as web service not from RTC but from c/al how it is possible?

below is the code i tried but not worked.

VAR 
WebService:	Record	Web Service Aggregate	;
CLEAR(WebService);
WITH WebService DO BEGIN
 IF GET (56000) THEN
   "Object Type" :="Object Type"::Page;
    
   "Object ID" := 5600;
   "Service Name":= 'MyPage';
   Published:= TRUE;
   
 INSERT(TRUE);
 END;


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at

    Hi!

    GET never works. remove it.

    It should be

    VAR

    WebService: Record Web Service Aggregate ;

    CLEAR(WebService);

    WITH WebService DO BEGIN

      "Object Type" :="Object Type"::Page;

      "Object ID" := 5600;

      "Service Name":= 'MyPage';

      Published:= TRUE;

      "All Tenants" := TRUE;

      INSERT(TRUE);

    END;

  • Suggested answer
    Suresh Kulla Profile Picture
    50,247 Super User 2025 Season 2 on at

    Use the codeunit 9750 it already has a function CreateWebService, just provide the Object Type, ID, Service Name and TRUE parameter to publish.

  • Muhammad Arif Maseed Profile Picture
    782 on at

    Andrey Baludin  have you tried the code ?

    it generating the error "The Web Service Aggregate table is empty".

  • Muhammad Arif Maseed Profile Picture
    782 on at

    Thanks for response 

  • Suggested answer
    4BzSoftware Profile Picture
    6,073 on at

    Hi Muhammad,

    Try below code:

    VAR WebService: Record Web Service Aggregate;

    CLEAR(WebService);

    WITH WebService DO BEGIN

      SETRANGE("Object Type", "Object Type"::Page);

      SETRANGE("Object ID", 56000);

      IF NOT FINDFIRST THEN BEGIN

        "Object Type" := "Object Type"::Page;

        "Service Name" := 'MyPage';

        "Object ID" := 56000;

        Published := TRUE;

        INSERT(TRUE);

      END

      ELSE BEGIN

        Published := TRUE;

        MODIFY(TRUE);

      END;

    END;

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans