How to deal with "Operation aborted" error when sending list update via Sharepoint REST?
By : Abu Hadid
Date : March 29 2020, 07:55 AM
help you fix your problem The api call requires authentication. I managed to use WinHTTP to authenticate the request based on the current user, I am assuming that they have access in the below. I get a 204 response and my list item updates correctly. (the iteration is because I was testing performance and can be removed). Tools>references>Microsoft WinHttp Services Version 5.1 code :
Private Sub UpdateItem2(ID, strFormDigest As String, iteration)
Dim sUrl As String
sUrl ="https://123.Sharepoint.net/sites/123/_api/web/lists/getbytitle('MyDemoList')/items(" & ID & ")"
Dim oRequest As WinHttp.WinHttpRequest
Dim sResult As String
sEnv = "{ '__metadata': { 'type': 'SP.Data.MyDemoListListItem' }, 'Title': 'TEST" & iteration & "' }"
Set oRequest = New WinHttp.WinHttpRequest
With oRequest
.Open "POST", sUrl, True
.setRequestHeader "IF-MATCH", "*"
.setRequestHeader "X-HTTP-Method", "MERGE"
.setRequestHeader "accept", "application/json;odata=verbose"
.setRequestHeader "X-RequestDigest", strFormDigest
.setRequestHeader "content-type", "application/json;odata=verbose"
.SetAutoLogonPolicy AutoLogonPolicy_Always
.send sEnv
.waitForResponse
End With
End Sub
|
How to add status "active" or "Inactive" in sharepoint list items. By using sharepoint designer?
By : user2221301
Date : March 29 2020, 07:55 AM
this one helps. The requirement seems so close as this one I tested, you may check my test solution. code :
<select id='selectItems' multiple='multiple'></select>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/SiteAssets/MultiSelectjQLib/multi-select.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<!-- Bootstrap JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
<script src="/SiteAssets/MultiSelectjQLib/jquery.multi-select.js"></script>
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(custom, "sp.js");
function custom() {
var clientContext = new SP.ClientContext.get_current();
//update list as your list
var list = clientContext.get_web().get_lists().getByTitle("MultiSelectTest");
//get the first item only, you may update the logic per you requirement
var items = list.getItems(SP.CamlQuery.createAllItemsQuery());
clientContext.load(items);
clientContext.executeQueryAsync(
function () {
var listItemEnumerator = items.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
var _Title = oListItem.get_item('Title');
var _Status = oListItem.get_item('Status');
var _ID = oListItem.get_item('ID');
if (_Status) {
$('#selectItems').append($("<option></option>").attr("value", _ID).text(_Title));
} else {
$('#selectItems').append($("<option selected></option>").attr("value", _ID).text(_Title));
}
}
$('#selectItems').multiSelect({
afterSelect: function (values) {
alert("Select value: " + values);
var oListItem = list.getItemById(values);
oListItem.set_item('Status', false);
oListItem.update();
clientContext.executeQueryAsync(
function () {
alert('update complete');
},
function (sender, args) {
console.log(args);
}
);
},
afterDeselect: function (values) {
alert("Deselect value: " + values);
var oListItem = list.getItemById(values);
oListItem.set_item('Status', true);
oListItem.update();
clientContext.executeQueryAsync(
function () {
alert('update complete');
},
function (sender, args) {
console.log(args);
}
);
}
})
},
function (sender, args) {
console.log(args);
})
}
</script>
|
How to update "list-item" in SharePoint directory
By : Cmptr Engnr
Date : March 29 2020, 07:55 AM
With these it helps Are you sure that column SentORReceived really exist? It should be internal name of a column. If you used different name when creating the column and then renamed, you need to use the original one.
|
Microsoft Graph API: SharePoint: Get items list in "default Drive" of "root Site"
By : user3663450
Date : March 29 2020, 07:55 AM
Any of those help Instead of using .../v1.0/sites/$site_id/drives/... for working with drives, I switched to using .../v1.0/drives/$drive_id/..., and this worked. The following Microsoft Graph API request above using /v1.0/sites/root/drives/[** URL-Encoded DRIVE_ID **], the return previously acquired default drive (identified by [** DRIVE_ID **]) metadata: code :
curl "https://graph.microsoft.com/v1.0/drives/[** url-encoded DRIVE_ID **]" \
--request GET \
--verbose \
--silent \
--header "authorization: Bearer [** ACCESS_TOKEN **]" \
--header "Content-Type: application/json"
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity",
"createdDateTime": "2012-06-12T17:27:56Z",
"description": "Share a document with the team by adding it to this document library.",
"id": "[** DRIVE_ID **]",
"lastModifiedDateTime": "2015-03-03T02:39:56Z",
"name": "Shared Documents",
"webUrl": "https://docusign2com.sharepoint.com/Shared%20Documents",
"driveType": "documentLibrary",
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"lastModifiedBy": {
"user": {
"displayName": "System Account"
}
},
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
}
curl "https://graph.microsoft.com/v1.0/drives/[** url-encoded DRIVE_ID **]/root" \
--request GET \
--verbose \
--silent \
--header "authorization: Bearer [** ACCESS_TOKEN **]" \
--header "Content-Type: application/json"
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('[** url-encoded DRIVE_ID **]')/root/$entity",
"createdDateTime": "2012-06-12T17:27:56Z",
"id": "[** ROOT_FOLDER_ID **]",
"lastModifiedDateTime": "2020-02-07T16:04:09Z",
"name": "root",
"webUrl": "https://docusign2com.sharepoint.com/Shared%20Documents",
"size": 27781340,
"parentReference": {
"driveId": "b!mWxqgLJ9mESqZI4PrP0Gs-F4hgLaCRlCkVuON4nbwzhkKbcyWdM1Tb5WEzNJ0C60",
"driveType": "documentLibrary"
},
"fileSystemInfo": {
"createdDateTime": "2012-06-12T17:27:56Z",
"lastModifiedDateTime": "2020-02-07T16:04:09Z"
},
"folder": {
"childCount": 5
},
"root": {}
}
curl "https://graph.microsoft.com/v1.0/drives/[** url-encoded DRIVE_ID **]/items/[** ROOT_FOLDER_ID **]/children" \
--request GET \
--verbose \
--silent \
--header "authorization: Bearer [** ACCESS_TOKEN **]" \
--header "Content-Type: application/json"
|
Update sharepoint 2013 custom list's field "Modified" C#
By : Andrew Davidson
Date : March 29 2020, 07:55 AM
this will help If you change your Update call to a SystemUpdate call; that should do the trick.
|