0

I want to save data into list but it gives me error when used following code.

var item = {
    "__metadata": { "type": "SP.Data.ListNameListItem" },
    "Hyperlink": { Url: $('[id$=txtLinksURL]').val(), Description: $('[id$=txtLinksDescription]').val()}
};

{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US"
,"value":"The property 'Hyperlink' does not exist on type 'SP.Data.ArticleHyperlinksListItem'. Make
 sure to only use property names that are defined by the type."}}}

How to set Hyperlink Value Using JQuery?

1 Answer 1

0
function setPublisingHyperlinkValue(fieldInternalName,url,description)
{
    var fieldUrl = $('input[id ^=' + fieldInternalName +  '][id $=UrlFieldUrl]');
    var fieldDesc = $('input[id ^=' + fieldInternalName + '][id $=UrlFieldDescription]');
    fieldUrl.val(url);
    fieldDesc.val(description);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.