Skip to Content
avatar image
Former Member

Hard coded (non relative) URL found when initializing oData URL in a model

Hi Folks,

I am creating an oData model object in my controller.js with the following code.

	var url="";
	var oModelData = new sap.ui.model.odata.v2.ODataModel(url,true);

My View is below

		<Label text="Products" />
				<Text text="{/Products}" />

When I am trying to write the code, it is throwing the error "Hard coded (non relative) URL found"

Please help me rectifying my mistake.



error.png (28.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 16, 2017 at 08:22 AM


    Normally the Odata model will be set in the manifest.json and the entitysets are read in controller.js.

    Also,this northwind service will not work unless you set the destination to avoid the Cross domain issue.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sindhuja,

      As soon as you open the manifest.json file.You are able to see Descriptor Editor and Code Editor.

      Click in Descriptor Editor --> Data Sources --> Click on Plus symbol(It will Prompt a Dialog)

      there you need to select your added system(For your case it is northwind system you added in your destination) and select the service and click next followed by finish.

      Now this will add OData service in manifest.json file.

  • Nov 16, 2017 at 11:30 AM


    Place your url in manifest.json or component.js if you're not using manifest.json

    Add comment
    10|10000 characters needed characters exceeded