- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我为用户设置了生日。我需要删除这个生日,但我做不到。
我已经尝试过文档中的 PATCH 方法,但字段不能为空。然后我用 PATCH/PUT/DELETE 尝试了多次调用,但我总是有错误。
在 Delve 中,当我们删除生日时,它会变成 '0001-01-01T00:00:00Z'
。我试图用这个值来修补生日,但我得到了未知错误:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.UnknownError",
"message": "Unknown Error",
"innerError": {
"request-id": "678fbda6-5fb9-4bc0-91c3-7af2238c1673",
"date": "2018-05-28T09:16:20"
}
}
}
最佳答案
我们可以使用下面的 SharePoint REST API 来设置用户个人资料的生日。
/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty
示例代码:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var requestHeaders = {
'X-RequestDigest': $("#__REQUESTDIGEST").val(),
"accept": "application/json; odata=nometadata",
"content-type": "application/json;odata=nometadata"
};
var userData = {
'accountName': "i:0#.f|membership|user@lz.onmicrosoft.com",
'propertyName': 'SPS-Birthday', //can also be used to set custom single value profile properties
'propertyValue': ''//set empty value
}
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty",
type: "POST",
headers: requestHeaders,
data: JSON.stringify(userData),
success: function (data) {
console.log(data)
},
error: function (jqxr, errorCode, errorThrown) {
console.log(jqxr.responseText);
}
});
});
</script>
注意:修改上面代码中的“accountName”并将代码添加到 SharePoint 页面中的脚本编辑器 Web 部件中。
关于javascript - 是否有将用户生日设置为 null、空或默认值的解决方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50563029/
如果我在 forms.py 中有: birthdate = forms.DateTimeField() 和 html: 我需要创建一个新的小部件还是有答案?
我正在尝试从 facebook sdk 获取生日,我可以获取我的生日,但我无法从其他帐户获取生日。我已经在“设置”中设置了联系人电子邮件,并在此处回答了一个应用程序供公众使用:Set up app p
我需要存储用户的出生日期。我在前端创建了一个表单,通过 3 个选择下拉菜单获取他们的出生日期年、月和日。我目前将这三个值存储在 SQL 中,并具有相同名称的列。 我需要执行的查询之一是获取高于或低于特
我有 mysql 数据库,以生日列作为日期。 保存到此列的最佳方式是什么,年份是可选的。我应该随便放一些年份吗?在数据库中保存生日的最佳做法是什么。 我在 cakephp 中创建了 3 个文本字段,日
考虑到此代码(基于 Python/Mongoengine),我知道如何找到下一个即将到来的生日 class User(mongoengine.Document): (...) birthday
在以前版本的 Prestashop 1.6 中,注册表单有生日字段的日期选择器和一个下拉列表,我们可以在其中选择月、日、年。 Prestashop 版本 1.6 - 生日截图: 然后在最新版本的Pre
我正在使用带有changeYear 的jquery ui datepicker。问题是它以 block 的形式显示年份(从 1985 年到 2005 年,然后单击 1985 年打开其他年份)我需要显示
我正试图在来自佛蒙特州和纽约的成员(member)的生日表中找到最年长的人。我的成员类似于以下内容: Members ------- MemberID, Firstname, Lastname, Bi
工作中需要用到身份证验证,还要支持检查15位和18位。 我一时手懒,问同事有没有现成的函数可用,同事google了一下,扔给我一个 asp-vbscript版本的函数。 可我这边是客户端j
我正在努力解决以下正则表达式: \b[\dBb][-. \dEe]+(\d{4})\b 它应该匹配帐号,但不匹配 token /生日或其中包含“be”的文本。在 community 的支持下,我成功捕
我有一个简单的小部件,它有: 请注意,今天是生日。因此,它意味着保持相同,无论您身在何处(不应该发生时区)。如果您 1 月 10 日凌晨 3:00 出生在英国,并且在纽约查看您的个人信息,您应该仍然
在我的数据库中,日期存储为 dd/mm/yyyy。当我检索它时,我想将日期分别拆分为字符串日、字符串月和字符串年。我应该怎么做? “/”将是分隔符,对吗? 最佳答案 您需要可以使用DateTime.P
我很难通过 Facebook SDK 获取用户信息。 我正在努力争取生日、工作和教育。 我正在使用这个: let graphRequest : FBSDKGraphRequest = FBSDKGr
我正在尝试使用 NSSortDescriptor 按日期对 NSMutableArray *friends, key:birthday 进行排序,我的 NSLog 中的所有生日都为空,但名称仍在记录中
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我正在尝试从其 Google Plus 帐户获取用户的信息,包括性别和年龄。由于这些字段可能是私有(private)的,我认为明确请求它们可以解决问题。然而,尽管登录对话框明确指出该应用程序请求查看您
我正在制作一个 facebook 应用程序来显示用户的生日......... 'YOUR_APP_ID', 'secret' => 'Y
我正在尝试将 OAuth2 登录添加到我基于 Node/ExpressJS/MongoDB/PassportJS 构建的应用中。 我用这个方法可以成功登录,但是我无法获取某些信息。我唯一能够访问的是
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我无法让我的代码来获取我的测试帐户的“生日”,甚至我自己的“生日”(任何地方都没有成功!)来回显,尽管从我所看到的来看,我正在正确地请求它并且我拥有适当的权限对于“user_birthday”。 但是
我是一名优秀的程序员,十分优秀!