Posts

Showing posts from 2013

Forcing InfoPath forms to load in web browser view - SharePoint

Scenario and solution: You have a page that containd web part views into your forms library (that contains forms that can be filled out in a browser). The problem here is that if you or your client has InfoPath installed on their computer, everytime they click the link the form will try and open in their InfoPath client; prompting them for authentication. If the client goes to the forms library itself and clicks on a InfoPath form the form opens in the browser no problem, why? The answer is in the url, try this: Go to the forms libray and click on a form, check the URL; it should look something like this: "http://site.example.com/subsite/_layouts/FormServer.aspx?XmlLocation=/subsite/formLibrary/formName.xml&Source=http%3A%2F%2Fsite%2Eexample%2Ecom%2Fsubsite%2FformLibrary%2FForms%2FMyView%2Easpx&DefaultItemOpen=1 No go the web part and click the same form, check the URL (in the browser status bar): http://site.example.com/subsite/formLibrary/formName.xml Note that the ...

Auto-Generating Filenames for InfoPath Forms

Image
http://claytoncobb.wordpress.com/2009/06/20/auto-generating-filenames-for-infopath-forms/ Auto-Generating Filenames for InfoPath Forms – I see this topic come up a LOT on forums all over the place, so instead of continuing to answer the question time and time again, I am going to post a quick blog entry showing the steps.  I think this stuff is fairly simple, but it just doesn’t pop into your head initially.  Once you see it and understand it, you’ll think it’s simple, too.  Keep in mind that I focus entirely on SharePoint-based InfoPath forms and for the most part BROWSER-ENABLED forms.  So, it’s possible and likely that all concepts explained here will work for non-browser forms and non-SharePoint forms, but just remember that my perspective is mostly browser-enabled.  The basis for this topic is that the standard method for submitting InfoPath browser-enabled forms is for the user to click Save at which point the user is prompted to give a filename along ...

Exporting Documents (folder structure) from SharePoint to Local Drive

http://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx?pr=blog

SharePoint 2010 List view Print

Please use the below URL for WSP download http://spprintlistbutton.codeplex.com/

Create a SharePoint Custom Action to Zip and Download a Document Set

Image
Here’s the URL to the built-in document set downloader page: {SiteUrl}/_layouts/DocSetExport.aspx?List={ListId}&ID={ItemId}. It takes in the GUID of the list and the ID of the document set. Here’s an example: http://sharepoint2010/sites/docman/_layouts/DocSetExport.aspx?List={4E2D11F5-7500-476A-B001-62A7BF92FD50}&ID=10 Adding a Custom Action to the Document Set List Item Menu using SharePoint Designer To add a custom action, open the site in SharePoint Designer and navigate to the document set list. Add a new list item menu custom action: Provide a Name, Description, and Navigate to URL: Save the custom action, and test it: I want to mention that there is a drawback to this approach. The custom action will show up for every list item, not just the document set. The list item menu will appear on documents in the document set as well: Adding a Custom Action to the Document Set Ribbon using SharePoint Designer We can also use SharePoint Designer to add a button ...

Update Hyperlink Field in SharePoint with PowerShell

I want to change the URL in list item from https://Texas.com to https://ta.com  using Powershell script 1) copy & paste (change the URLs and Listnames and field) the below script and name it with extension .ps1 (ex: ItemURLChange.ps1) #Add-PSSnapin Microsoft.SharePoint.PowerShell $siteUrl = "http://sharepoint/SiteCollection/SiteName" $webName = “SiteName” $listName = "Name of your list" $spSite = new-object Microsoft.SharePoint.SPSite($siteurl) $spWeb = $spSite.OpenWeb($webName) $spList = $spWeb.Lists[$listName] foreach($Item in $spList.Items ) { $ofldurl= new-object Microsoft.SharePoint.SPFieldUrlValue($Item["URL"]) $ofldurl.URL = $ofldurl.URL.Replace("Texas", "ta") $ofldurl.Description = $ofldurl.Description.Replace("Texas", "ta") $item["URL"] = $ofldurl $item.update() } $spWeb.Dispose() 2) Open the Powershell command and run using the below command PS C:\temp...

Email / Phone validation in SharePoint 2010 Column validation

=(LEN(LEFT([Email Address],FIND("@",[Email Address])-1))>0)+(LEN(RIGHT([Email Address],LEN([Email Address])-FIND(".",[Email Address],FIND("@",[Email Address]))))>0)+(LEN(MID([Email Address],FIND("@",[Email Address])+1,FIND(".",[Email Address],FIND("@",[Email Address]))-FIND("@",[Email Address])-1))>0)+(ISERROR(FIND(" ",[Email Address]))=TRUE)=4 -------------------- Phone Validation (example: 123-456-7896x486): =AND(LEN([Phone Number])=16,IF(ISERROR(FIND("",[Phone Number],1)),FALSE,(FIND("",[Phone Number])=1)),IF(ISERROR(FIND("-",[Phone Number],4)),FALSE,(FIND("-",[Phone Number],4)=4)),IF(ISERROR(FIND("-",[Phone Number],8)),FALSE,(FIND("-",[Phone Number],8)=8)),IF(ISERROR(FIND("x",[Phone Number],13)),FALSE,(FIND("x",[Phone Number],13)=13)),IF(ISERROR(1*CONCATENATE(MID([Phone Number],1,3),MID([Phone Number],5,3),MID(...

Specify page to redirect to when adding a item (new form or edit form)

1. Open your Newform.aspx page 2. Add a CEWP. Type following line in your site url ( http://serverip/Lists/Test/NewForm.aspx?&toolpaneview=2 ) 3. Paste below script in source code <script> function PreSaveAction() { var srcUrl=GetSource(); var newSrcUrl = "http://www.google.com"; var i = aspnetForm.action.lastIndexOf(srcUrl); aspnetForm.action = aspnetForm.action.substring(0,i) + newSrcUrl ; return true; } < /script> --------------------------------- JQuery for Cancel button: Use the following jQuery code to override the behavior of the cancel button: $(function() { $('input[value=Cancel]').click(function() {history.go(-1);}); });

Rename button Text in NewForm.aspx or EditForm.aspx

Rename button Text in NewForm.aspx or EditForm.aspx in SharePoint  Lists <script type="text/javascript"> function changeFinish() { var inputs = document.getElementsByTagName("input"); for(i = 0; i<inputs.length; i++) { if(inputs[i].type == "button" && inputs[i].value == "Save") inputs[i].value = "Submit"; } } _spBodyOnLoadFunctionNames.push("changeFinish"); </script>

Clear SharePoint Desinger Cache

Sometimes SharePoint Designer loses touch with reality - it demands to check out files that are not checked in, refuses to check in other files and generally misbehaves. This demeanor is sometimes accompanied by this error message: "Cannot perform this operation. The file is no longer checked out or has been deleted." Simply put, SharePoint Designer is out of sync with SharePoint and you have to delete its cache in order to rebuild it. The cache is composed of these 2 folders: %APPDATA%\Microsoft\Web Server Extensions\Cache %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache Just delete their contents and you are done. C:\Documents and Settings\%LocalUser(Ravi)%\AppData\Local\Microsoft\WebsiteCache

Hiding Sharepoint 2010 Ribbon in New Form.aspx with Jquery

//using below script you can hide entire ribbon //$(“div.’s4-ribboncont:contains(‘Spelling’)”).parent(‘div’)[0].style.display = “none”; //using below script you can hide ribbon but the dark blue background will remain visible //$(“div.ms-cui-tabContainer:contains(‘Spelling’)”).parent(‘div’).hide(); //using below script you can hide save Button in Ribbon //$(“span.ms-cui-ctl-largelabel:contains(‘Save’)”).parent(“a”).hide(); //using below script you can hide past Button in Ribbon //$(“span.ms-cui-ctl-largelabel:contains(‘Paste’)”).parent(“a”).hide(); //using below script you can hide Cancel Button in Ribbon //$(“span.ms-cui-ctl-largelabel:contains(‘Cancel’)”).parent(“a”).hide(); //using below script you can hide Attachment Button in Ribbon //$(“span.ms-cui-ctl-largelabel:contains(‘Attach’)”).parent(“a”).hide(); //using below script you can hide Cut Button in Ribbon //$(“span.ms-cui-ctl-mediumlabel:contains(‘Cut’)”).parent(“a”).hide(); //using below script you can hide Copy Button ...

Customizing the Request Access page in SharePoint 2010

Image
This article is Based on below URL : http://oszakiewski.net/eric/customizing-the-access-request-page-in-sharepoint-2010 Our organization, like many others, handles access requests for all applications through our IT Support desk. Additionally, documentation is required and must be approved by the user’s department manager before the access can be granted. After just recently migrating the entire company’s intranet over to SharePoint 2010, I wanted to allow users to request access, so I made sure the Manage Access Requests was selected by default for all resources. However, within a week of moving it over I’m getting requests for all sorts of things in my inbox every day, even from our kiosk service accounts in the employee break room or at terminals, which are both locked down intentionally. I don’t mind the access requests, but there needs to be a consistent way of handling requests that complies with our internal standards. I did some research into the Access Request email m...

HTML Formatter

Formats a HTML string/file with your desired indentation level. The formatting rules are not configurable but I think it provides the user with the best possible output. Note that the formatter will keep spaces and tabs between content tags such as divs and spans as it's considered to be valid content. *Files bigger than 1 meg will be formatted to a new window. Good tool for HTML format: http://www.freeformatter.com/html-formatter.html

How to transfer logins and the passwords between SQL Servers

http://sqlserver.in/blog/index.php/archive/category/administration/database-migration/

Step-by-Step Guide to Configuring Database Mirroring in SharePoint 2010

Image
I was looking up some material on database mirroring, and I could find a good step-by-step post on setting up such functionality. So here it is! Read these posts before you begin - you should really understand the concepts if you are to undertake this, especially in a production environment. http://technet.microsoft.com/en-us/library/dd207314.aspx http://blogs.technet.com/b/wbaer/archive/2010/05/03/database-mirroring-in-sharepoint-2010.aspx http://www.sharepointbandit.com/2010/08/configure-database-mirroring-on.html My SQL instances are based on the SQL Server 2008 R2 Standard SKU, but they we're upgraded from SQL Express 2008 R2, hence the sqlexpress names: Mcm-server-1\sqlexpress (Primary) & Mcm-server-2\sqlexpress (Mirror) SQL Service Account: mcm\svc_sql Database to sync: WSS_Content_ProductionDB For mirroring to work, the versions of SQL must be the same on both servers. 1. Configure permissions on the mirror server according to the details from the technet art...