Hot answers tagged

6

Use below code to get User name: new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupValue; For User ID: new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupId;


3

You can create a Custom Timer Job which will monitor the items. Just compare the current date and item modified field. For example var lastModified = (DateTime.Now - (DateTime) item["Modified"]).Days; If the duration is greater than or equal to 20 days, then take action. Steps of creating Custom Timer Job for on-premise, find here Create and Deploy Custom ...


3

Find folder name from ServerUrl of your document. It should look like "/{LibraName}/{FolderName}/{fileName.extention}" So the folder is always before the document. Coding Changes cqy.set_viewXml("<View Scope='RecursiveAll'> <ViewFields> <FieldRef Name='ID'/> <FieldRef ...


1

If you want to show the total number of items shown in a pie chart you can use the DataTable class's getNumberOfRows() method to get the number and then display this number somewhere on the page next to the pie chart. See reference here: https://developers.google.com/chart/interactive/docs/reference#DataTable If what you meant is you want each slice on ...


1

GUIDs are globally unique. You should never find two things with the same GUID in any system anywhere. A programmer has made a mistake if you do. So to answer your question - no, List Item GUIDs are not list dependent.


1

You are confusing your list item ID values which are 1-based integers with the SPListItemCollection index which are 0-based integers. If you examine the output of the MSDN sample code here: SPListItem.ID property you will see SPListItemCollection index doesn't match the list item ID. In addition, if you look here: SPListItemCollection.Item property ...


1

My understanding is that by using: properties.ListItem["Staff Member"].ToString(); You are going to be returned their userID and username, so it will always be returned separated by ;#. You're probably already using something like: properties.ListItem["Staff Member"].ToString().split(";#")[1]; To return the username on it's own. You should compare the ...



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