Monday, 8 May 2017
Delete SharePoint list item using REST API
Solution:
Here I create 1 variable as follow:
1)
url : REST
API with list name
var url =
"/_api/Web/Lists/GetByTitle('CRUDList')/getItemById('1')";
Function:
function deleteItem(url) {
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl +
url,
type:
"DELETE",
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"If-Match": "*"
},
success:
function (data) {
alert("Record deleted.");
},
error:
function (error) {
alert(JSON.stringify(error));
}
});
}
Function call:
deleteItem(url);
Feel free to revert in-case of any query...
Product Applies To:
· SharePoint Server 2013
· SharePoint Foundation 2013

Update SharePoint list item using REST API
Solution:
Here I create 2 variables as follow:
1)
url : REST
API with list name
2)
data :
this variable contain the column name with respective values
var url =
"/_api/Web/Lists/GetByTitle('CRUDList')/getItemById('1')";
var data =
{
__metadata: { 'type': 'SP.Data.CRUDListListItem'
},
Title: 'Update title'
};
Function:
function
updateItem(url, updateData) {
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + url,
type: "PATCH",
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"content-Type": "application/json;odata=verbose",
"X-Http-Method": "PATCH",
"If-Match": "*"
},
data:
JSON.stringify(updateData),
success:
function (data) {
console.log(data);
},
error:
function (error) {
alert(JSON.stringify(error));
}
});
}
Function call:
updateItem(url,data);
Feel free to revert in-case of any query...
Product Applies To:
· SharePoint Server 2013
· SharePoint Foundation 2013

Add SharePoint list item using REST API
Solution:
Here I create 2 variables as follow:
1)
url: REST
APi with list name
2)
data:
this variable contain the column name with respective values
var url =
"/_api/Web/Lists/GetByTitle('CRUDList')/Items";
var data = {
__metadata: { 'type': 'SP.Data.CRUDListListItem' },
Title: 'Some title'
};
Function:
function addNewItem(url, data) {
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl
+ url,
type:
"POST",
headers: {
"accept":
"application/json;odata=verbose",
"X-RequestDigest":
$("#__REQUESTDIGEST").val(),
"content-Type":
"application/json;odata=verbose"
},
data:
JSON.stringify(data),
success:
function (data) {
console.log(data);
},
error:
function (error) {
alert(JSON.stringify(error));
}
});
}
Function call:
addNewItem(url,data);
Feel free to revert in-case of any query...
Product Applies To:
· SharePoint Server 2013
· SharePoint Foundation 2013

Saturday, 2 July 2016
SharePoint bloggers and their blogs
SharePoint 2013 & 2010 reference books
Microsoft SharePoint 2013: Designing and Architecting Solutions
Microsoft SharePoint 2013: Planning for Adoption and Governance
Exam Ref 70-331: Core Solutions of Microsoft SharePoint Server 2013
Exam Ref 70-332: Advanced Solutions of Microsoft SharePoint Server 2013
SharePoint 2013 User's Guide, 4th Edition
Developing Business Intelligence Apps for SharePoint
Pro SharePoint 2013 Business Intelligence Solutions
Pro SharePoint Disaster Recovery and High Availability, 2nd Edition
Pro SharePoint 2013 App Development
SharePoint 2013 Branding and User Interface Design
SharePoint 2013 For Dummies
Business Intelligence in Microsoft SharePoint 2013
Pro SharePoint 2013 Administration, 2nd Edition
Microsoft SharePoint 2013 Inside Out
Microsoft SharePoint 2013: Designing and Architecting Solutions
Exploring Microsoft SharePoint 2013
Beginning SharePoint 2013
============================= SharePoint 2010 =============================
Pro SharePoint 2010 Development for Office 365
Practical SharePoint 2010 Branding and Customization
Working with Microsoft FAST Search Server 2010 for SharePoint
Practical SharePoint 2010 Information Architecture
Pro SharePoint with jQuery
Microsoft SharePoint 2010 Business Application Blueprints
SharePoint Server 2010 Administration 24 Hour Trainer
Microsoft SharePoint 2013: Planning for Adoption and Governance
Exam Ref 70-331: Core Solutions of Microsoft SharePoint Server 2013
Exam Ref 70-332: Advanced Solutions of Microsoft SharePoint Server 2013
SharePoint 2013 User's Guide, 4th Edition
Developing Business Intelligence Apps for SharePoint
Pro SharePoint 2013 Business Intelligence Solutions
Pro SharePoint Disaster Recovery and High Availability, 2nd Edition
Pro SharePoint 2013 App Development
SharePoint 2013 Branding and User Interface Design
SharePoint 2013 For Dummies
Business Intelligence in Microsoft SharePoint 2013
Pro SharePoint 2013 Administration, 2nd Edition
Microsoft SharePoint 2013 Inside Out
Microsoft SharePoint 2013: Designing and Architecting Solutions
Exploring Microsoft SharePoint 2013
Beginning SharePoint 2013
============================= SharePoint 2010 =============================
Pro SharePoint 2010 Development for Office 365
Practical SharePoint 2010 Branding and Customization
Working with Microsoft FAST Search Server 2010 for SharePoint
Practical SharePoint 2010 Information Architecture
Pro SharePoint with jQuery
Microsoft SharePoint 2010 Business Application Blueprints
SharePoint Server 2010 Administration 24 Hour Trainer
Saturday, 12 April 2014
SharePoint number
column should accept only numbers
Solution:
<script type="text/javascript">
$(document).ready(function () {
$('input[Title="ColumnName"]').keydown(function (e) {
var
keyCode = e.which; // Capture the event
//190
is the key code of decimal if you dont want decimals remove this condition
keyCode != 190
if
(keyCode != 8 && keyCode != 9 && keyCode != 13 &&
keyCode != 37 && keyCode != 38 && keyCode != 39 &&
keyCode != 40 && keyCode != 46 && keyCode != 110 &&
keyCode != 190) {
if
(keyCode < 48) {
e.preventDefault();
}
else if (keyCode > 57 && keyCode < 96) {
e.preventDefault();
}
else if (keyCode > 105) {
e.preventDefault();
}
}
});
});
</script>
Subscribe to:
Posts (Atom)