在SharePoint Online的列表中为3列强制实施唯一值 [英] Enforce Unique Values for 3 columns in a list on SharePoint Online

查看:95
本文介绍了在SharePoint Online的列表中为3列强制实施唯一值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我设计的解决方案有4个列表如下:

用户将按以下方式填写此 HCM列表:


要求用户不得能够 期间,如果列表中已经存在该期间,则我将期间"列配置为"强制唯一值" ,如下所示:


这是自定义示例 SharePoint 用户将提交的表单.



地区列表 单列,如图所示



用户开始测试并发现 期间字段可以,但是当他们选择不同区域不同 子公司 相同时期,例如 2< sup> nd</sup> 2017财年下半年, 在此期间始终存在的地方,他们获取此消息:

因此,我进行了配置这 区域列为"实施唯一值" ,如下所示:

当我单击确定 按钮,我收到此消息

我尚未配置 ; subsidiary list ,但尚未提供"实施唯一值".

问:如何实现"强制唯一值" 列表中的3列,或者只有在Region,Subsidiary和Period不相同时,用户才能通过其他方式强制用户.

我在 TechNet .

我可以采取任何建议来解决用户的问题. ,谢谢.


桑迪

解决方案

在列值中强制唯一性是防止在同一列下显示相同数据的唯一方法,但这并不意味着它将与其他列相关联并使它们唯一.

如果要使三列唯一,我们可以使用REST API和jQuery代码来实现此功能.

< script type =" text/javascript"src =" http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"</script>
< script type =文本/javascript">

//保存Ajax结果的变量
var dataResults; 


(function(){ //将JavaScript添加到按钮onclick事件中以调用checkExist()函数 var oc =


("input [value ='Save']")[1] .getAttribute(" onclick);


Hi All,

 

I have designed a solution has 4 lists as follows: 

Users will fill in this HCM list as follows: 


The requirements are that users should NOT be able Period the same period if that period has already existed in the list so I configured period column as "Enforce unique values" as shown:


This is sample of custom SharePoint form that user will submit. 



Region list single column as shown 



Users start testing and found that the period field is okay, but when they choose the different region and different subsidiary for the same period like 2<sup>nd</sup> Half FY2017, where this PERIOD always exists, they get this message:



So I configured the Region column as "Enforce unique values" as shown:


and when I click OK button I get this message

I have not configured  subsidiary list yet for the "Enforce unique values".

Q: How to achieve "enforce unique values" for 3 columns in a list or there is any other way to users to enforce users only when Region, Subsidiary and period are NOT the same.

I found something related to enforce unique values at TechNet.

Any suggestion I could do to solve user’s issues. Thanks, in advance.


Sandy

解决方案

Hi,

Enforcing Uniqueness in Column Values is the only means to prevent appearing same data under one column, it doesn’t mean that will relate to other column and make them unique.

If you want to make three columns unique, we can use REST API and jQuery code to realize this function.

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">

//variable to hold Ajax result
var dataResults;


(function(){ //adding javascript to button onclick event to call checkExist() function var oc =


("input[value='Save']")[1].getAttribute("onclick");


这篇关于在SharePoint Online的列表中为3列强制实施唯一值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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