I am trying to implement a feature in a list from WSS3.0.
Basically I have a list and I want to add items to the list but I want to check first if there is already any item with the same value in a specific column.
I have a column named "My Key Field" and I want the values in this field to be unique. So, for example, if I have a record in the list where "My Key Field=65 210" I should not be able to add a new item when a users inserts the same value for the "My Key Field".
Any ideas on how to do this? A simple solution would be great considering my lack of skills concerning to Sharepoint programming....but I am flexible and I can learn.
Thanks for your attention!
Regards,
Aganju
The SPServices library has a method for this, called SPRequireUnique. It relies on SharePoint Web services.
For the record, you get this feature out of the box in SP 2010.
Related
Is it possible to attach details from one sharepoint list to another like vlookup in excel? For example if I type unique index in one field, all details will be import from another sharepoint list. Any ideas how to do that? Can't find any solution.
You could use lookup column in the SharePoint list.
Reference: How to create a Lookup column in SharePoint
Sharepoint lists are not linkable like tables in relative databases. You could write a webpart or script or something else to 'connect' them.
You can use the APIs to get their contents and write a function which processes the contents. After processing you could use another API to write the results in another SharePoint List.
GET List_1 Data
GET List_2 Data
Process(List_1_data, List_2_data)
POST result to List_n
I am trying to populate unique values across a multiple columns in a SharePoint list. For example if we have "column A" with value "X", none of the columns should accept the value "x" in the entire list.
Is it possible?
I tried the formula using an example.
=IF([columnA]=[ColumnB],TRUE,IF([ColumnB]<>"",TRUE,FALSE))
But i felt stupid as i had no idea why i feel it is right. But it doesn't work
Any simple and better ideas will be a great help!
I think you need PreSaveAction for this requirement, when item saving, the function will execute for client side validation, then you could call rest api to validate column A value and user input value, when return false, means validation failed and item will not save.
Demo thread.
https://sharepoint.stackexchange.com/questions/255633/limit-edit-in-sharepoint-list-to-only-3-items-per-user
SharePoint rest api filter.
https://www.c-sharpcorner.com/article/sharepoint-2013-using-rest-api-selecting-filtering-sortin/
I'm trying to enable content editors to select an item that resides in a bucket in a droplink field but I'm unable to find a field type/datasource that enables this.
I need to allow the user to select a single item (so not a multilist), the items are in a bucket as the number of items may be huge and the search api would be most helpful to the editors.
Is there a field or datasource query that will enable a lookup field to select a single bucketed item?
The simplest solution is to use a Sitecore multilist with search field.
First you need to set the source of your field to display items within your bucket of a specific template(s).
Example: StartSearchLocation={11111111-1111-1111-1111-111111111111}&Filter=+_templatename:sample item
Here is an article describing how to set the source of your field: Sitecore 7 field types
If you need to limit the selection to one item then you need to also apply some regex. To achieve this you need to enable standards values in the view tab so you can alter the data section.
In the data section add the following regex: ^({[^}]+}\|?){0,1}$ and add some validation text.
Example:
This article provides additional infromation:Limit selected items on Sitecore multilist field
Just in case anyone else comes across this as I did, you can also use a query in the source field to filter the items in a droplink.
query:/sitecore/content/Home/YourBucket//*[##templateid='{your-template-guid}']
You can also use ##templatename='Your Template Name'
Keep in mind that unless your bucketed items aren't numerous (for some reason), the suggested answer is probably better since it provides search, and will not create a massive dropdown list of items.
I made some custom fields for this very purpose: https://github.com/Barsonax/SitecoreSearchFields
It gives you the same rich search interface you normally get when searching in buckets.
Is it possible to choose only specific items from the list in selectOneMenu?
For example. I have List Products has many fields like name, id etc. One of it is category (1,2 or 3) I want to have only one category in the selectOneMenu without making new Lists and new classes. Can you help me?
I think the easiest way is to set the value attribute of f:selectItems to a method which filters your original collection.
Otherwise you'd have to implement your own version of f:selectItems which allows filtering - as we once did in one of our projects.
What is the best way to implement a parent-child hierachy between items in a list? The requirement is as follows
-> there is a list item with a particular ID
-> that particular ID could have related records.
-> all those related records should show up when viewing the list item
When the user adds a new item to list using a form, they should have the option to choose whether the new item being added has another related item or not.
The primary question here is what would be the best way to establish this hierarchy in the list? Also, all the items would be in the same list so how
would we link the list to itself? Or, what would be the best way to implement this? I can figure out several approaches to handle this within the confines of the
sharepoint server object model; however, this needs to be done primarily within the UI of Sharepoint itself (webparts, features, etc. may be used). However,
I am not sure how to IMPLEMENT THIS WITHIN THE SHAREPOINT CONTAINER ITSELF.
Any ideas/insights would be greatly appreciated.
Thanks
You can create a look up column in list with a parent list as itself and allow multiple selections. That way you will be able to check multiple parent IDs for a specific list item.
To show related list items, you can customize details view page of the list in sharepoint designer and add list view web part or dataview with appropriate filters based on the current item.