I am new to sharepoint.I am getting below error on ajax call i dont know where it is occuring.
"{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"
An entry without a type name was found, but no expected type was specified.
To allow entries without type information, the expected type must also be specified when the model is specified.\"}}}"
The below is the code which I used Please reply as soon.
var camlQueryRequest = { query: { __metadata: { type: "SP.CamlQuery" }, ViewXml: "" } }; var CamlViewXml = "A150434";
var query = new Query();
var camlquerybuild;
query.SPSiteUrl = _spPageContextInfo.webAbsoluteUrl;
query.QueryType = "CAML";
query.RequestMethod = "POST";
query.RequestHeaders = {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "POST",
"content-length": 0,
"content-type": "application/json;odata=verbose",
"If-Match": "*"
};
camlQueryRequest.query.ViewXml = CamlViewXml;
camlquerybuild = camlQueryRequest;
var camlquery = JSON.stringify(camlquerybuild);
self.QueryData = camlquery;
query.RequestHeaders["content-length"] = self.QueryData.length;
self.SearchUrl = query.SPSiteUrl + "/_api/web/lists/" + "getbytitle('RFA')/Items?$select=ID,ESI_ProjectSeqNoLookupId";
$.ajax(
{
url: self.SearchUrl,
method: query.RequestMethod,
headers: query.RequestHeaders,
data: self.QueryData,
success: function (data) { deferredObject.resolve(data); },
error: function (data) { deferredObject.reject(data); }
});