• SP 2010: How to redirect InfoPath form to a custom Thank You page

    Problem: Although Info path gives you the ability to create a custom message after submission, lots of users have requested more than that. They haven’t been happy with the way the form just leaves you sitting there in the List, it can be confusing. So we have a way in which you can make an InfoPath form function like a traditional web form wherein you fill out the form and upon clicking the ‘Submit’ button, the user is taken to a Thank You page

    Resolution:

    1. Create a Thank You page and save it somewhere on your site. We recommend using any editor, like Notepad or SharePoint Designer to create an html page with a message of your choosing such as “Thank You for your submission”

    2. Click on that Thank You page and record the URL I.E., it will look something like this: http://mydomain.com/sites/YourSite/YourDocLibrary/ThankYou.html

    3. Now you need to figure out the URL to your InfoPath form. Either click on it and record the URL or if you have attached the InfoPath form to a SharePoint List, then you will need to alter the URL like this: http://mydomain.com/sites/YourSite/YourList/NewForm.aspx, as you can see we just added the NewForm.aspx to the end of it.

    4. Take the URL you recorded in step 3 and add the following: ?Source=http://mydomain.com/sites/YourSite/YourDocLibrary/ThankYou.html, So the URL should look like this: http://mydomain.com/sites/YourSite/YourList/NewForm.aspx?Source=http://mydomain.com/sites/YourSite/YourDocLibrary/ThankYou.html << this is the link you will send to your users in order to fill out your form. When your users click on this new link, it will tell SharePoint to automatically redirect them to your Thank You page after they submit.

    On that Thank you page you can add a link to go to another page or you can get real fancy and add a Meta refresh tag to automatically take redirect your users, for example, to the home page of your site. How do you do that? Simple. Add this line: <meta http-equiv="refresh" content="2;url=http://mydomain.com/sites/yourSite/"> in between the <head></head> tags of your HTML page. Just to explain a little more about that line, the number 2 in this case represents 2 seconds. So you can modify that to keep the user on that page longer or shorter by replacing that number with a different one. The url would be the url of your home page or any other site you want to redirect the user to.

    Fight Comparison:

    Tyson vs. Spinks…this one was easy.

  • SharePoint 2013: Workaround: Cannot add web part to Community Portal page

    Requirement: Customer wants to add a Content Editor web part to Community Portal page 

    Problem: When user clicks on the Gear icon>> 'Edit Page', then clicks 'Add a Web Part' there is no response

     Workaround: Below is an out-of-the-box workaround. 

    1. Create a 'Web Part Page' (via
           SPD 2013 (SharePoint Designer 2013) or the GUI). 
                NOTE: It doesn't matter where this page lives, it will serve as
           nothing more than a place to create the Content Editor Web part and
           configure it to export to your Community Portal page.
    2. Add the Content Editor Web
           part to this 'Web Part Page' and configure it as you wish. (I added some
           text and a few hyperlinks.)
    3. Save this page.
    4. Open this page in SharePoint
           Designer 2013 and choose 'edit file'. Locate the Content editor web part
           code. The easiest thing to do is locate the tag
           <WebPartPages:ContentEditorWebPart and click on it. Now look towards
           the bottom right of SharePoint Designer and you will see a highlighted tab
           that says <WebPartPages:ContentEditor…>. Click on that tab, it will
           select all the code you need.
       
    1. Copy the code (crtl+c)
    2. Open the Community Portal in
           SharePoint Designer 2013
    3. Click on 'Edit home site page'

                 
    4. Right-click on 'default.aspx' and choose 'New from Existing Page'

                 
    5. This will create a copy of default.aspx called 'untitled.aspx'. Go to 'File>>Save As', and name
           it something like 'default2.aspx'.
    6. In the code, locate the tag
           <WpNs1:ExistingCommunitiesWebPart runat="server"
           Title=""…Place your cursor in front of it and hit 'Return'. This
           will give you some space to paste in the Content Editor Web Part
           code

                 
    7. Paste the Content Editor code
           (ctrl+v)
    8. Click 'Save'
    9. Right-click on default2.aspx (or whatever you named this page) and choose 'Set as Home Page' (This will
           now set this new page as the default home page so that when users browse
           to your Community Portal via http://domain/sites/CommunityPortal ) it will automatically go
           to this page (in my example default2.aspx)

                 
    10. Browse to your community
           portal and you will now see the Content Editor Web part there.           

                Note: I also deleted/commented out the search web part because it will now throw an
           error up at the top right

                 
    11. Go back to the code for
           default2.aspx page (or whatever you named it) and look for the tag
           <spsswc:SearchBoxScriptWebPart, click on it. Just like before, a
           highlighted tab will appear on the bottom right corner of your screen.
           Click that tab to select the code you need to remove or comment out.
    12. Remove or comment out, then     Save. You should be good now.

                 
  • SharePoint 2010: No new ULS logs being generated

    Problem: Customer discovered that the ULS logs had stopped generating. Within the Logs file there were files but from an old date.

    Troubleshooting: I looked in Event viewer and found this:

    Tracing Service failed to create the trace log file at location specified in SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\LogDir Error 0x0: The operation completed successfully. . Traces will be written to the following directory: C:\Windows\SERVIC~2\LOCALS~1\AppData\Local\Temp\.

    Resolution:

    1. In Central Admin go to Monitoring>>Configure diagnostic logging
    2. changed the ‘Path’ value to C:\Temp and then back to D:\SharePoint\Logs
      (They have the logs being written to the D drive which is common, changing it back and forth resolved this problem)

    Fight Comparison
    Fedor vs Arlovski:
    This was an easy one that was a weird resolution but it worked. Kind of like when Fedor was getting pushed back by Arlovski, and then decided to throw a Hail Mary punch to his face, knocking him out cold.

  • Powershell: How to convert a ‘Single line of Text’ column to ‘Multi-line of Text’

    Problem: Customer needed a way, via PowerShell to convert a column from single line of text to Multi-line of text. I first verified that the column they were trying to convert was not the default ‘Title’ column, I would not recommend touching that one. The customer had run into an issue where the Single Line of text column’s 255 character limit was truncating some entries.

    Solution:

    $web=Get-SPWeb "http://nameOfSite"

    $list = $web.Lists["NameOfList"]

    $column = List.Fields["ColumnName"]

    $script:noteFieldType = [Microsoft.SharePoint.SPFieldType]::Note

    $column.Type = $noteFieldType

    $column.Update()

    $web.Dispose()

    NOTE: Remember to run these scripts with the correct permissions. When the customer ran it the first time, they had some vague errors like 'Cannot index into a null array'. Found out they were logged into the server as themselves, once they logged in as a farm account, the script worked fine.

    Fight Comparison:
    Mike Tyson Vs. Carl ‘The Truth’ Williams…easy KO

  • SharePoint 2010: Missing user profile from user profile service

    Problem:  a single user profile would not appear in the user profile store (Central admin >> Application Management >> Manage Service Applications >> user profile service>>Manage User Profiles). The user did exist in Active Directory.

    Troubleshooting:

    • Ran an incremental sync
    • Ran a full sync
    • Looked at ULS logs and found this error:

       "System.Net.WebException: The remote server returned an error: (404) Not Found.
         at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
         at System.Net.WebClient.DownloadData(Uri address)
         at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.DownloadPictures(ProfileChangeData[] profiles, Boolean delayErrors)
         at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.Microsoft.MetadirectoryServices.IMAExtensibleFileImport.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData)
      Forefront Identity Manager

    Cause: Customer is on October 2012 CU, this is fixed in December 2012 CU. It happens because some users added a picture to their profile and then removed it at some point.

    Resolution: Upgrade to a higher patch or, until you can plan and test the patch properly, you can perform the workaround below:

    1. Run the following SQL Query against the profile database to identify user accounts that may be missing and not coming over via your syncs:
       
      SELECT el.RecordId,el.ChangeType,el.ChangedPropertyId, el.EventTime,el.OldValue,el.NewValueData,upf.RecordID,upf.NTName,upf.PictureUrl,upf.PreferredName 
      FROM UserProfileEventLog as el
      JOIN Userprofile_full as upf
      On el.recordid=upf.recordid
      where ChangedPropertyId =23 and eventtime > '2013-03-13' and ChangeType = 4
    2. Modify eventtime to reflect the previous day or longer as appropriate
    3. ChangeType 4 reflects that the operation on the property was a delete. ChangedPropertyId =23 is the profile picture property
    4. The list of users generated from the above query will then need to have their photo updated via central administration. You can then update the photo for the user with the default gif, person.gif.

    Fight Comparison: Had to call for help on this one, so more like a professional wrestling tag team match