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
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;
Thanks for response
Andrey Baludin have you tried the code ?
it generating the error "The Web Service Aggregate table is empty".
Use the codeunit 9750 it already has a function CreateWebService, just provide the Object Type, ID, Service Name and TRUE parameter to publish.
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;
Sohail Ahmed
2
mmv
2
Amol Salvi
2