Archive
Search Issues with SharePoint 2010
I was recently asked to take a look a SharePoint 2010 UAT server that was showing some very odd search behaviour. The rest of SharePoint was working fine but search results were only bringing back web pages, no other content was appearing in the search results.
We tried the normal trouble shooting steps such as clearing the config cache and resetting the search indexes but nothing seemed to help, we checked the crawl, event and ULS logs but nothing seemed to point to an problem.
We finally resorted to creating a new search application and adding to the default group. After running a full crawl we had a full set of results back as expected, the only step left was to move the existing crawl rules from the old search application to the new one.
After moving the crawl rules across from the original search application to the the new one the same result issues appeared, so it was obvious that one of the 10+ crawl rules in operation was causing the issue, we removed the rules one at time and reran a full crawl each time to check the results, we finally found the offending rule (below) with a URL exclusion of ‘http://*/forms’ , this seemed to have the effect of stopping the crawler component going into the hidden forms folder and crawling content via that route.
Getting the logged on user name using the client object model
If you want to use the SharePoint 2010 client object model you can use the code below:
ExecuteOrDelayUntilScriptLoaded(getWebUserData, “sp.js“);
var context = null;
var web = null;
var currentUser = null;
function getWebUserData() {
context = new SP.ClientContext.get_current();
web = context.get_web();
currentUser = web.get_currentUser();
currentUser.retrieve();
context.load(web);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),
Function.createDelegate(this, this.onFailureMethod));
}
function onSuccessMethod(sender, args) {
var userObject = web.get_currentUser();
var UserTitle = userObject.get_title();
alert(UserTitle);
}
function onFailureMethod(sender, args) {
alert(‘request failed ‘);
}
Here is a video and a simple way to test it.
SP.UI.ModalDialog.showModalDialog with margin and notification
If you ever add HTML to a SharePoint modal dialog box you might notice that adding a left-margin is also necessary. Remember, the HTML option uses DOM not a string.
Style margin Property
Get the code
Adding SP.UI.ModalDialog.showModalDialog to a content editor webpart
Client Object Model: SP.UI.ModalDialog.showModalDialog(options)
Opening a hyperlink in a dialog box in SharePoint 2010
How do I: Add new values to a drop-down list from the new item form
If you want to have the ability to add new values from new form item you have two options. (that I know of) First you could use $().SPServices.SPLookupAddNew. Or, you could use the technique I have demonstrated in the video below.
Related videos:
How do I: Set the ID attribute of a table row using jQuery and SharePoint Designer
While customizing an “add new item” form, you might find yourself needing to manipulate form elements via jQuery. However, before you can do that you must and an #id or .class to the elements in question. I will be adding an #id in this demonstration. But why would I want to manipulate form elements in the first place? If you wanted to hide/show a textbox based on the user selection of a checkbox you could use this technique.
How do I: Implement $().SPServices.SPLookupAddNew
Using jQuery to hide/show form elements based on checkbox value
How can I validate a textbox using the PreSaveAction()
How do I: Create a simple form to collect data in SharePoint 2010
How can I hide/show a textbox based on a radio button selection?
How can I hide/show a textbox based on a drop-down value?
How do I: Implement $().SPServices.SPCascadeDropdowns
Documentation for $().SPServices.SPCascadeDropdowns
In my opinion, the tricky part to this is the third list “CascadeExample”. It was unclear to me after reading the documentation on the SPServices website that the two columns “Country” & “Region” in the “CascadeExample” list need to be lookup columns. It might be obvious to everyone else.
Hiding/Showing InfoPath 2010 form element using jQuery
Get the code / Look for the highlight area
InfoPath 2010 is a great tool. However, while building forms in InfoPath it’s only a matter of time when you have a user requirment that InfoPath alone simply will not do. In that case you might have a few options. You could add custom code using VSTA, which means you will need to publish them as an administrator approved form template.You could ditch InfoPath completely and build your forms in Visual Studio 2010 using asp.net. You could build them using the client object model. Lots to think about. In addtion, you could manipulate some form element using jQuery. The video demonstrates a simple way to hide/show a textbox element using jQuery.
Using jQuery to hide form elements based on checkbox value
Let’s say you wanted to hide/show a specific textbox only if a specific checkbox has been selected. You can use jQuery to do this via SharePoint Designer 2010
How can I validate a textbox using the PreSaveAction()
How do I: Create a simple form to collect data in SharePoint 2010
How can I hide/show a textbox based on a radio button selection?
Why can’t I access the column in my SharePoint list programatically?
The answer might be simple. The first time a column is created and you title it “Column1” the database records that. If you (or someone else) later changes the column title to “Column2” your application will break. Why? Because behind the scenes that column is still “Column1”
How do I: Create a FAQ page in SharePoint 2010
This was done on a SharePoint Online site.
You must be logged in to post a comment.