It seems that some of the success in coding comes from no more than persistence. A lot of what I do to get stuff to work takes trial and error.
For example: I was trying to get something modified in SharePoint 2010: specifically, make it so that when the user uploaded a document, the user wasn’t also prompted to fill in a form of metadata fields (I wanted the fields to be populated programmatically). I was stumped, so I hit the Googles.
I found this page, which, frankly, was confusing as hell, owing probably to the non-native English of the posters (don’t get me wrong, I have SUPREME respect for non-native English speakers who regularly use the ‘net to find technical information). I tried some of the sample code, but nothing worked. One poster suggests putting the code in a web part at the end of the web form, and another more towards the beginning. There’s also about 4 samples of code to use.
So I actually resorted to trial and error. Trying various code blocks both before and after the web part in question. It took me a while, but I finally got it to work. What I had to do was combine the code from one post and the placement of the code from another post. And voila.
So what am I trying to convey, other than how much SharePoint can suck?
Mostly, that it’s about not giving up. Fanatically trying something, and if it doesn’t work, trying something else, and if that doesn’t work, trying something really nuts and out of the box until maybe that works. It doesn’t matter what I’m working on, or how good the platform is, or how much of an expert I am in the platform.
That’s the key in this line of work. Try and try again, and be willing to color outside the lines and try whatever crazy idea you can think of to get it to work.
(Just in case you surfed here looking for a similar answer to the SharePoint issue, here’s exactly what to in SP 2010:
- Navigate to the doclib in question in your browser
- On the ribbon, under “Library”, select “Form Web Parts”->”Default Edit Form”
- When the webpart edit form comes up, click on “Add a Web Part”
- From “Categories” select “Media and Content”, and from “Web Parts” select “Content Editor”
- Click “Add” on the right
- Put the cursor inside the “Content Editor” web part that has been added to the form
- From the Ribbon, select “HTML”->”Edit HTML Source”
- Copy and paste the following JS code into the popup window:
- Click OK
That’s all. The next time a user uploads a document, no edit form will appear.)