Domanda

I have a list with 3 columns that are currently relevant:

Customer Code | Product Line | Part Number

I want to enforce unique values across all 3, so that at least one value of the three columns needs to be different.

If this were an excel spreadsheet, this would be easy to solve using the concatenate function. However, calculated columns in SharePoint cannot be used for validations in that same way it seems.

Notes:

-Customer Code is a lookup column (not sure if that matters here)

-This will primarily be used in data sheet view, with users pasting in many rows of data from an excel sheet

I've read that event receivers could help to solve this, but I do not currently have access to Visual Studio 2010. Any alternative solutions/workarounds are much appreciated!

È stato utile?

Soluzione

While SharePoint is typically backed by a SQL Server database, the SharePoint platform is not a traditional database and thus does not provide features like composite keys for list item identifiers.

You are correct that you would need to add this type of functionality yourself and one such way is event receivers. Event receivers would work because they are triggered at the moment the user save the record and thus validation code in the event receiver can prevent the save.

I don't think workflows would work here given that the record would need to be saved in order to trigger the workflow. Another option might be client side code or an app that is added to check your records and determine whether or not to allow the form submission.

Altri suggerimenti

I have made my own client side validation by populating data from sharepoint web service.

hope this can help you

https://www.codeproject.com/Tips/1205585/Unique-Entries-Based-on-Multiple-Columns-in-Sharep

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top