AL0296: The type or method 'Initialize' cannot be used for 'Extension' development.

Hello Everyone 

I am getting below error when I am compiling the code in VS code editor

AL0296: The type or method 'Initialize' cannot be used for 'Extension' development.
AL0296: The type or method 'SetReturnType' cannot be used for 'Extension' development.

I am using below code in code unit

procedure CallRESTWebService(var Parameters: Record RESTWebServiceArguments): Boolean
var
TempBlob: Record Tempblob temporary;
HttpWebRequestMgt: Codeunit "Http Web Request Mgt.";
JsonInStream: InStream;

begin
TempBlob.INIT();
TempBlob.Blob.CREATEINSTREAM(JsonInStream);
CLEAR(HttpWebRequestMgt);
HttpWebRequestMgt.Initialize(Parameters.URL);
HttpWebRequestMgt.SetReturnType('application/json');
//HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetReturnType('application/json');
HttpWebRequestMgt.SetContentType('application/x-www-form-urlencoded');
HttpWebRequestMgt.AddHeader('Accept-Encoding', 'utf-8');

I am using the below version of VS code editor

Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

App. json

"publisher": "Default publisher",
"brief": "",
"description": "",
"version": "1.0.0.0",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"capabilities": [],
"dependencies": [],
"showMyCode": true,
"screenshots": [],
"platform": "13.0.0.0",
"application": "13.0.0.0",
"features": ["TranslationFile"],
"idRange": {
"from": 50000,
"to": 50149
},
"runtime": "2.1"
}

Am I missing something? any suggestion.

Thanks 

Devesh

Parents Reply Children
No Data
Related
Recommended