Skip to main content

Notifications

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

  • Suggested answer
    4BzSoftware Profile Picture
    6,073 on at
    RE: Register page as a web service dynamic nav ???

    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;

  • Muhammad Arif Maseed Profile Picture
    782 on at
    RE: Register page as a web service dynamic nav ???

    Thanks for response 

  • Muhammad Arif Maseed Profile Picture
    782 on at
    RE: Register page as a web service dynamic nav ???

    Andrey Baludin  have you tried the code ?

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

  • Suggested answer
    Suresh Kulla Profile Picture
    47,789 on at
    RE: Register page as a web service dynamic nav ???

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

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at
    RE: Register page as a web service dynamic nav ???

    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;

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans