Tag Info

Hot answers tagged

4

Here is a script that gets the UniqueId of a list item: <script type="text/javascript"> $(document).ready(function() { ExecuteOrDelayUntilScriptLoaded( function() { var itemId = ....; // change to the real id var listTitle = .... // the list title var ctx = ...


3

First add the List Item so its Id is generated, than get the item again... Update its Title field and concat Id column with it.. Pseudo-code below: ListItem newItem = lstObject.Items.Add(); newItem["Field"] = "something"; newItem.Update(); newItem = lstObject.Items.GetItemById(newItem.Id); newItem["Title"] = "YourText" + newItem.Id.ToString(); ...


3

Hello Michal: There is nothing out of the box that would offer that functionality. Indexes are unique on a per column-basis and each column index is independent. The ItemUpdating event receiver is the best place to do this. You could simply have the event receiver query the list to see if a duplicate record exists before the item is created or saved.


2

Yes - you can use the file's GUID. Retrieve the GUID of an existing file using SPFile.UniqueId and open the file using SPSite.OpenFile(GUID).


2

Each question is essentially a column, you could ask the question in a different format. You have to tell yourself, if the questions aren't really identical in what it's asking, let's change the question. If the data being last year is what is unique, include that in the question. Otherwise you need to find a way to trick SharePoint to use the same format ...


2

Yes you can achieve this , and you will need to do enhancement the same . http:///_vti_bin/listdata.svc/Tasks?$filter=Team eq 'Team3' http://www.c-sharpcorner.com/uploadfile/anavijai/rest-api-in-sharepoint-2010-for-listdata-svc-part-1/


2

Both of these can be done with views using Group Bys. Create a view called ByPeriodPerson and in the Group By section of the view definition, select Period first group by the column and then select Person for the second group by the column. The resulting view will display a distinct set of Periods - when you expand each period you will have a distinct set ...


1

ODATA Distinct is not possible unfortunately: http://stackoverflow.com/questions/3839073/select-distinct-values-with-odata You may be able to filter distinct values out afterwards ?


1

I solved this problem by adding spaces at the end of the question. SharePoint accepted it and the user couldn't tell the difference.


1

A simple ItemAdding event receiver will do, where you check Uniqueness of the Priority by yourself.. So you can simply do an SPQuery with that Priority and Status = "Open" and get whether it already exists or not.. If exists, you can cancel the adding and write custom error.. properties.Cancel = true; properties.ErrorMessage = "Deleting is not supported."; ...


1

This particular resource string isn't one of the strings externalized in the RESX files in the 15 HIVE. The only way to really change it would be to create a custom form in InfoPath or in Visual Studio.


1

Create a list item event receiver SPItemEventReceiver and override the ItemAdded method. There you will always be able to grab the ID field from the properties parameter and assign it to a different field (single line of text or any other type). Attach the event receiver to your list and you are done. No workflow is required.


1

Normally the file is being checked out to the uploaded when not all mandatory information is filled in. The user needs to fill in the required fields before being allowed to publish the document


1

Maybe you could write an event receiver for Item-Added that would check the property you are interested in like Name and ensure it is unique.


1

You should be able to open up the 'Read' Permission level and create a new one based on it (at the bottom there should be a button saying such). Just add the Edit Items checkbox and not the Add new and you should be good to go.


1

You cannot do it without any use of code. I think the simplest solution to this is to use jQuery/JavaScript to make sure each answer is unique (on top of my head: each time a user select an answer i would save it in an array and then compare the next answer to the array - if there is a similar answer in the array then it’s not unique and i would show an ...


1

Are these documents stored in a document library? The list entry ID will never change, no matter how many times you change the name, meta data, etc. So you can always use a link such as http://sitecollection/library/forms/dispform.aspx?id={0} to show the "View Properties" screen for any file; there people can view the meta data and/or open the file.


1

You could use the Document ID Service that will uniquely identify a document. This will generate a unique identifier for the document and give it a distinct URL, from the referenced blog post, it'll look like, http://sitecollectionurl/_layouts/DocIdRedir.aspx?ID=MFSHF5F7ZUF5-1-1.



Only top voted, non community-wiki answers of a minimum length are eligible