I have a "Hyperlink" field type of "Publishing Hyperlink" i want to save data into list using JQuery But this field return an error.
var item = { "__metadata": { "type": "SP.Data.ListNameListItem" }, "Hyperlink": "<a href=\"/Documents/SampleFile.docx\" target=\"_blank\"><IMG src=\"/_layouts/images/icdoc.gif\" alt=\"\">Open [SampleFile.docx] in a new window</a>" }; // Executing our add $.ajax({ url: url + "/_api/web/lists/getbytitle('ListName')/items", type: "POST", contentType: "application/json;odata=verbose", data: JSON.stringify(item), headers: { "Accept": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val() }, success: function (data) { saveSuccess(); // success(data); // Returns the newly created list item information }, error: function (data) { //failure(data); } });
Error:
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"de-DE","value":"The property 'Hyperlink' does not exist on type 'SP.Data.ListNameListItem'. Make sure to only use property names that are defined by the type."}}}