I have a project that has a piece that uploads documents to a library in which versioning is turned on. Everytime I add a new document or update a document I get two versions per update call. Here is my code:
'create the spfile itemDim twoXtwoFile As SPFile = twoXtwo.RootFolder.Files.Add(fileName, fileBytes, True)
Dim twoXtwoItem As SPListItem = twoXtwoFile.Item
twoXtwoItem(twoXtwos.Year) = year
twoXtwoItem("Title") = fileName
twoXtwoItem(twoXtwos.Executive) = New SPFieldLookupValue(CInt(Request.QueryString("ID")), execItem(Execs.LookupName).ToString)
Catch ex As Exception
'display an error message
errorMessage.InnerText = "Sorry, but this file could not be added. Please try again or contact the IT Department Help Desk."Finally
The code runs fine, but when I go look at the version history of the document you can see where you have two versions that are the exact same. You really notice on the first upload where you have version 1.0, which is the file itself, and then version 2 that has the same file and the list column items added to it. All subsequent updates just contain two versions of the same update.
The only thing I can think of here is that my code is updating the file first and then going back and adding the list values to the object. Am I right to think that and what can I do so that I only have one version per update/add?
Well, as I see it, you add the file. That is one version. Then you take the file, change it values and update them. That's the second version.
Perhaps it would be a better way, to create the Item and add the file to it, change the properties and the add it to the list. I didn't tried it yet, so it may be wrong, but I think I did it once in that way.
To be honest, it's hard to answer without having a further look on the things you changed. So how do you created the custom master page? Did you use VS or SPD? If you used SPD did you removed one of the Placeholders? That would be a good option for creating errors on display. You should describe what you did and how you did and - that's important for me - which SharePoint-Version you use.
I have a Sharepoint list containing Name, Duration, Start Date, Finish Date, Predecessors, Outline Level, Notes and Project as the columns in that list. I've created a gantt view for that list. My problem is that, it shows the data from all the records, however I want to filter them based on the Project. I've figured out that a Gantt View doesn't connect to any other webpart in Sharepoint 2010 (I'm using Sharepoint 2010 foundation). How can I build a custom webpart to realize the same?
Use Visual Studio for creating an own Gantt-View, but I won't do that. There are many solutions you can buy. Gantt-View components for SharePoint are available from different developers and they're not expensive.
is there any emulator where I can visualize my infopath form as mobile view and check how the form will look like in mobile .
The reason is to check if any button or any part will be missing in mobile view of infopath forms.
I have created workflow using SharePoint designer and info-path forms for leave approval.
manager should open the infopath forms in mobile and approve/reject leave.
my approach is once employee applied for leave , workflow should start and notification /mail will be send to manager who will approve leave and manager should be able to view the approval form in "mobile" where he can approve / reject the request.
the question is the approval form is designed using info-path form and the mobile view of the form is not proper.
Kindly suggest how can i open the infopath form in mobile. is there anything to do during design of form or it can be handled through coding. I am using share point 2010.
Sounds like homework. If you want to see the advantages take a look at the features and then decide if your purposed are fitted. Google or better https://startpage.com[^] (Google search without IP tracking) could do this job.
I have a sharepoint 2010 platform with Database mirroring. The log files have grown to big in the region of 30GB for 5 of the content databases. is there a script that i can run to bring the database logs sizes down and at thesame time not break the mirroring. my databases are in Full recovery mode already and i make 1 full backup and 2 trans logs backup daily.
That's a SQL-Server issue. Set the recovery-modell for each sharepoint databse to simple instead of full.
In the full modell every transaction is saved, so you rerole every single action done after the database is set up. That's not nessassary. I backup the databases regularly, so no reverse of every transaction since the initial start of the sharepoint server farm is needed.
Ask you SQL-Server guru or chance it yourself in the database-options.
Using sharepoint designer I have inserted code for a listbox.
<asp:ListBox runat="server" id="lstRender">
I have a drop downlist as follows
<select name="dropRender" style="width: 174px">
I have to disable listitems - OSR and TTS upon selecting GR and
disable CR and EBR upon selecting CBR
I have used the following jquery code under placeholdermain:
if( $(this).val() == "GR")
$("select[id = lstRender]").attr("disabled",true);
This is not working for me.Please correct me if I am wrong.I am very new to Sharepoint and JQuery.
Last Visit: 23-Nov-20 8:56 Last Update: 23-Nov-20 8:56