Tag Info

Hot answers tagged

9

That could be due to localization. In that case, you should also set TitleResource property: field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title"); Actually, I've done renaming of Title plenty of times, and I can't see any difficulties there. Your SchemaXml approach probably didn't work for the same localization reason. By the way, ...


4

This sort of task is more suited to an event receiver. The itemAdded approach will certainly give you access to the ID. An event receiver does not have the typical delay you see with Workflows, it fires right away. One issue you can experience with ItemAdded events is that they run asynchronously. What this means is that the control is returned to the UI ...


4

Because you are uploading a file to an Asset Library, right after clicking "upload" you are shown the edit form, in order to fill some metadata that the library requires. Now, the ItemAdded event (which is *asynchronous *) is probably too early to try to change any of the file properties. I tried your code inside the ItemUpdated event and it worked ...


4

It is because SharePoint Multilingual User Interface (MUI) translates also column titles. What you did was that you overrode the default English MUI translation of the Title field to "title123". However, when you switch over to German MUI, it will use the German default translation of the Title field. You would need to change it also on the German MUI side. ...


3

Maybe you're site is still listed as a SPDeletedSite? Get-SPDeletedSite & Remove-SPDeletedSite You may already have used this site name before and deleted it. Check by running the following script: >Get-SPDeletedSite You'll see the site (or sites) listed, like this: WebApplicationId : 009c1289-392b-43a6-8222-146117074738 DatabaseId : ...


2

It seems to me that, while you can't delete the Name field, you could hide it in the edit form using jquery. There are a lot of articles on how to do this. Then you are right, you would need a way to populate it anyway, and I'm not sure an event receiver would work. Perhaps if it was on the "ItemAdding" event.


2

I only tried this in PowerShell, where I can confirm that SetValueForUICulture() doesn't persist the value (or rather it looks like it is set in the database, but GetValueForUICulture() retrieves the old value even though the internal property ResxBased is set to false). What worked for me was to not use SetValueForUICulture() but instead set the title ...


2

You need PowerShell to rename the Content Type on the specific list. I have written down a snippet for you that works on a specific list and update the Content Type name. You can extend it to for the other lists etc. $siteUrl = "http://YourServerName/sites/testsite" [system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint") > $null #get ...


2

Rename the server at the operating system level by using the System Properties dialog box in Control Panel. Restart Server   Change or create SQL alias (If no ALIAS, create one to point to the old servername so it finds the SQL Server that is on the same server, stand-alone installation.) using cliconfg Restart the server   Run PowerShell-command to rename ...


2

You can add a Item updating event receiver to your list. In that you can add your business logic to avoid renaming the file. For more on event receivers: http://karinebosch.wordpress.com/walkthroughs/event-receivers-theory/ http://beginnersbook.com/2013/02/event-receivers-in-sharepoint/


1

Seems like my problem is fixed. I added .Load() for a list item in the Rename method: try { item["Title"] = newName; item["FileLeafRef"] = newName; item.Update(); _clientContext.Load( item, i => i, i => i.FileSystemObjectType, i ...


1

check the below answers. will give you the idea how to achieve the target: Change name in ItemAdding event receiver or create a new Item also if you want to use WebDAV: http://simplyaprogrammer.com/2008/05/importing-files-into-sharepoint.html


1

You can do that in ItemAdded and make it synchronous so it will fire and execute in the same thread after ItemAdding is finished. You can make an after event syncronous when you define it in your solution, or you can do it with code or PowerShell script.


1

I would suggest to rather execute your code in the ItemAdded. Do not try to re-create another item inside, you just need to execute the code at the appropiate moment. Make sure you read this article to understand when the AfterProperties has values populated as it is different from List to Library and for each Event ...


1

Are you sure you are not re-firing your own event? You can disable event firing on update like this: EventFiringEnabled = false; // file.Update(); EventFiringEnabled = true; This link is for 2010, but it should still be valid for 2013: http://adrianhenke.wordpress.com/2010/01/29/disable-item-events-firing-during-item-update/


1

Use ItemAdding to prepare file for uploading and ItemAdded to kick off bussiness logic. This means, in your case, I would put all the code in ItemAdding event. In this way you can utilize properties.AfterProperties to rename file. properties.AfterProperties["Title"] = szNewFileName; Also, I'd recommended to access SPWeb as SPWeb web = ...


1

I recently have a similar requirement. I needed to rebrand a proof of concept into a well named product. I wrote this script to handle most of the job: $root = Get-Item C:\Projects\ $allFolders = Get-ChildItem $root -Recurse -Directory | Sort-Object FullName -Descending $allFiles = Get-ChildItem $root -Recurse | ? { -Not $_.PSIsContainer} | Sort-Object ...


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

Try the actual STSADM Command renameWeb (for the actual sub-site - http://technet.microsoft.com/en-us/library/cc263508(v=office.12).aspx) or renameSite (for a site collection - http://technet.microsoft.com/en-us/library/cc263038(v=office.12).aspx).


1

Try checking the item.AfterProperties or the item.AfterUrl. It's weird that you can't get the item by using its UniqueId, but you have to check other things as well. Is item in your case properties.ListItem, where properties is of type SPItemEventProperties? If not, that could also be the culprit as you should work with the item passed into your event ...


1

I was struggling with the exact same issue. I was just going to give it up, when I thought I'd give two other event receivers a try: ItemFileMoving and ItemFileMoved. And it worked! There is a logic to it I think, renaming and moving operations are somewhat alike. You can see it best when you're creating a new folder from Explorer/WebDAV. Immediately it ...


1

If you define a ListDefinition basen on your content type, you can set your own DisplayName <Fields> <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="New Title" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" /> </Fields> You can then ...


1

This cannot be done. If you remove the name from the content type folder, the folder will become unusable. Changing the display name is also not an option because it will affect the files that should be stored in the library to.


1

Create a new document. Paste in the contents from v1, Save and publish as a major version. Repeat for versions 2 and 3. You'll have the correct content version history but not who and when. There isn't a method I know of to merge and retain the information. Maybe the more code savvy folks have a way to do it programmatically that will do what you ...


1

Just use the powershell cmdlet called Rename-SPServer For instance: Rename-SPServer -Identity "mysqlname.mycompany.local" -Name "mysqlname" You will probably have to reprovision the User Profile Sync etc after it though.


1

check out http://technet.microsoft.com/en-us/library/cc512725.aspx, there's a trick you can do on the server to set a server alias.



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