OData Service Read Call

	/**
	 * @description OData Service Read Call
	 * @params {string} sParameter
	 * @returns {promise} oData Service Call
	 */
	_read: function(sParameter) {
		var oServiceModel = this.getOwnerComponent().getModel();

		return new Promise(function(fnResolve, fnReject) {

			var sPath = oServiceModel.createKey("/EntitySet", {
				Parameter: sParameter
			});

			var oParameters = {
				urlParameters: {
					"$expand": "toEntityB" //just as an example how we can pass urlParameters
				},
				success: fnResolve,
				error: fnReject
			};

			oServiceModel.read(sPath, oParameters);
		});
	}

Leave a Reply

Your email address will not be published. Required fields are marked *