将FieldUserValue设置为Disabled用户 [英] Set FieldUserValue to Disabled user

查看:106
本文介绍了将FieldUserValue设置为Disabled用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在将基于Infopath客户端的复杂表单转换为现代SharePoint加载项。

I am converting an old Infopath client based complex form, to a modern SharePoint add-in.

One要求是来自旧系统的数据被转换为新系统。该表单包含几个用户字段(一个负责人,一个经理,...),并且转换这些字段时我遇到了问题。

One of the requirements is that the data from the old system is converted to the new system. The form contains several user fields (a responsible, a manager, ...), and it is with converting these fields that I'm having an issue.

出于法律原因,这些数据必须保持5年,所以很多这些领域包含不再为公司工作的人。根据公司政策,这些帐户在AD中被禁用(未删除)。这些用户给我带来了麻烦:

For legal reasons this data must be kept available for 5 years, so a lot of these fields contain people no longer working for the company. By company policy these accounts are disabled in AD (not deleted). It are these users that are giving me trouble:


  • 首先我从旧项目中获得'FieldUserValue'
  • 我得到的'用户'(Microsoft.SharePoint.Client)基于FieldUserValue的lookupId(这可以使我得到登录名等..)
  • 然后我尝试使用基于的字段用户值保存新项目用户

=>例外'用户不存在或不是唯一的'(当然是真的)。​​

=> exception 'the user does not exists or is not unique' (which is ofcourse kind of true).

有没有办法让新系统中的'用户字段'接受这些旧的值? (我可以使用后备方案并将用户数据保存在旧字符串字段中,但这会污染数据库,并造成维护噩梦)。

Is there a way to have the 'User Field' in the new system accept these old values? (I could work with a fall back scenario and save the user data in old string fields but thats polluting the database, and a maintenance nightmare).

推荐答案

Hello Mini,



SPList.EnsureUser()函数不适用于已禁用的用户。



但是,因为您要删除用户从AD,你可以采用不同的方法与此列表。以下是一些想法:



1)不要使用人员选择器,只需使用文本框



2)使用人员选择器,但让工作流将其数据附加到不可编辑的文本字段。

Hello Mini,

SPList.EnsureUser() function does not work with disabled users.

However, since you are deleting users from AD, you could take a different approach with this list. Here are a few ideas:

1) Don't use the people picker, just use a text box

2) Use the people picker, but have a workflow append its data to a text field that is not editable.

3)扩展您的Web应用程序 使用"表单身份验证"和用于用户数据的SQL数据库。在那里创建所有'假'用户。所以这些用户无法访问计算机。

3) Extend your web application used 'Forms Authentication' and SQL database for user data. create all the 'fake' users there. So these users without computer access.


这篇关于将FieldUserValue设置为Disabled用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆