Tag Archives: SharePoint Designer

FIXED – SPDActivities Custom Action (SharePoint 2016 )

After troubleshooting an issue with SharePoint Designer, I wanted to document the fix for others.   Installing the “DP.CustomActions” WSP from CodePlex worked well on SharePoint 2010 and 2013.   However, with 2016 an issue occurs which requires additional [web.config] modification.   Details below.   Cheers!   shades_smile

Issue

  1. WSP is fully deployed and installed
  2. Custom Action workflow steps are visible in SharePoint Designer
  3. Click action then suggestion menu disappears.   No action sentence is visible on designer.

image

Resolution

  1. Locate </targetFx> in [web.config] file
  2. Add below XML code both before AND after </targetFx>

<authorizedType Assembly=”DP.Sharepoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0298457208daed83″ Namespace=”DP.Sharepoint.Workflow” TypeName=”*” Authorized=”True” />

  1. IISRESET
  2. Clear SharePoint Designer client cache https://stackoverflow.com/questions/43113666/how-to-clear-cache-in-sharepoint-designer-site
  3. Test

image

Root Cause

  • Appears that SharePoint 2016 leverages more Dot Net Framework versions (3.0, 3.5, 4.0, 4.5) and has a larger [web.config] to support backward compatibility with multiple Dot Net versions.

FIXED – The version of Microsoft SharePoint Foundation running on the server is more recent than…

While working with SharePoint Designer and opening sites in Office 365 I came across the below cryptic error message.   The root cause is lack of permission.  Granting SCA fixed.

Cheers!

shades_smile

Error

After opening URL SharePoint Designer client displays “The version of Microsoft SharePoint Foundation running on the server is more recent than the version of SharePoint you are using. You need a more recent version of SharePoint Designer.”

image

Resolution

While unclear, the above is actually a permission denied error.   Grant the user account more permissions, such as Site Collection Admin (SCA), and you will connect OK.


Get Design View back on SharePoint 2013 (woohoo!)

Want to use Design View on a 2013 site?  Well, now you can.

With a Fiddler HTTP function we can adjust the server response to say “14” instead of “15” and open any SharePoint 2013 site with SharePoint Designer 2010 to have access to classic Design View.   Obviously there are downsides to this approach (not formally supported), but it also can be useful in many scenarios.  Check it out and please leave a comment if you find this helpful.

 

Instructions

  1. Download Fiddler http://www.telerik.com/fiddler
  2. Download SP Designer 2010 http://www.microsoft.com/en-us/download/details.aspx?id=16573
  3. Launch Fiddler, press Ctrl + R, and update the Custom Rules JS file with the code below
  4. Launch SP Designer 2010 and open site URL
  5. Have fun!

Fiddler

You need to add Custom Rules to Fiddler.  There are two options:

  1. Download CustomRules.JS with custom logic
  2. Copy the below code and add to your local CustomRules.JS file in the function OnBeforeResponse(oSession: Session).

// START BLOG POST from @spjeff 
// https://www.spjeff.com/2014/05/08/get-design-view-back-on-sharepoint-2013-woohoo
//INF
if (oSession.oRequest["User-Agent"] == "Mozilla/4.0 (compatible; MS FrontPage 14.0)" &&
	oSession.PathAndQuery == "/_vti_inf.html") {
	// Remove any compression or chunking
    oSession.utilDecodeResponse();
    if (oSession.responseBodyBytes) {
        var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
    
        // Replace strings
        oBody = oBody.replace("FPVersion=\"15.00.0.000\"", "FPVersion=\"14.00.0.000\"");
        oSession.utilSetResponseBody(oBody); 
    }
}
//RPC
if (oSession.oRequest["User-Agent"] == "MSFrontPage/14.0" &&
	oSession.PathAndQuery == "/_vti_bin/shtml.dll/_vti_rpc") {
	// Remove any compression or chunking
    oSession.utilDecodeResponse();
    if (oSession.responseBodyBytes) {
        var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
    
        // Replace strings
        oBody = oBody.replace("major ver=15", "major ver=14");
        oSession.utilSetResponseBody(oBody); 
    }
}
 
//AUTHOR
var suffix = "/_vti_bin/_vti_aut/author.dll";
if (oSession.oRequest["User-Agent"] == "MSFrontPage/14.0" &&
	oSession.PathAndQuery.indexOf(suffix, oSession.PathAndQuery.length - suffix.length) !== -1) {
    if (oSession.responseBodyBytes) {
        // Remove any compression or chunking
        oSession.utilDecodeResponse();
        var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
    
        // Replace strings
        oBody = oBody.replace("
  • SR|15.0", "
  • SR|14.0"); oSession.utilSetResponseBody(oBody); } } // END BLOG POST
  •  

    Use Cases

    • Support upgraded 2010 sites.    If you developed with SP Designer 2010, you might need Design View to support sites after upgrade to 2013.
    • New HTML and CSS creation.  WYSIWYG can be great for making simple files to support new JavaScript development.
    • DataFormWebPart .  Create blank ASPX page, add the DataFormWebPart and Conditional Formatting with WYSIWYG, then copy finished <DataFormWebPart> code tag into a 2013 native ASPX page.

    Notes

    • Non intrusive approach.   Fiddler runs local on the developer’s machine.   No server changes or changes for end users.
    • This doesn’t give you Design View of any native 2013 ASPX page.  Those are fundamentally different with new Minimal Download Strategy async load, new master page, and other stuff so it just shows a gray background.
    • Not formally supported.
    • Cool way to support SP2010 upgraded sites.

    References

     

    homer-computer-woohoo

     

    5-8-2014 3-41-29 PM

    Manually Run “Pause Until” SharePoint Designer Workflows

    Recently I needed to simulate a future lapse in time in order to manually trigger the “Pause Until” SharePoint Designer function.  In the example below, the SharePoint server is a local DEV virtual machine running in Oracle VirtualBox.  That means it receives time from the parent machine.

     

    Action Steps

    1. Move VM host clock forward 1 day (24hours)
    2. Move VM guest clock forward 1 day (24 hours)
    3. Run the Powershell command “Get-SPTimerJob | ? {$_.name –like ‘*workf*’} | Start-SPTimerJob

     

    What the above steps will do is to simulate a future date and then trigger the SharePoint workflow engine.  If the engine finds any past-due activities (ex:  “Pause Until ___”) then it will execute those immediately.  Using this technique you can build “Pause Until ___” workflows and still test them to ensure everything completes as expected, without having to actually wait the full time.  Smile

     

    image

    image

    image

    image

    SPD Best Practice: Ctrl C+V Quick Backups

    To quote Asif Rehmani (@asifrehmani) from www.sharepoint-elearning.com … “SharePoint Designer is like a really sharp knife.   It’s very good at what it does.   You might cut yourself.   But you don’t stop, just act more carefully.”

     

    With that lesson well learned over my years with SharePoint customization I must say my favorite trick of all is the simple quick copy/paste backup.   Any time and every time I’m about to jump off a cliff to dive into SPD coding I perform a Quick Backup:

    • Highlight the file
    • Ctrl+C    (copy)
    • Ctrl+V    (paste)
    • Breathe a sigh of relief

    Storage is cheap.   Mistakes are not.   Time is one of our most scarce resources.   Buy some insurance with a Quick Backup!   Hot

     

    image

    image

    _WPQ_ with Javascript for dynamic lookup

    If you’re using the trusty CEWP (Content Editor Web Part) to locate the current web part frame on a page you’ll want to consider using the “_WPQ” expression instead of hard coding a number.    Using the Internet Explorer Developer toolbar or Firebug toolbar is a great way to locate <DIV> tags and “ID=” attributes with a single click.

    However, don’t be tempted to code in the number.    As you re-order web parts they will changes.    If you add more than one CEWP (export/import) the others will fail.    Use a dynamic token for maximum flexibility.

    SharePoint’s rendering engine does a search replace on “_WPQ_” to give it the number of that web part on the page.   It’s a great way to avoid naming conflicts and a trick I’ve used to apply multiple JQuery driven CEWP on the same page.

     

    References

    image

    URL Source= for Thank You on Submit

    Many times I’ve been asked to adjust the NewForm.aspx (add record) experience for users to display a custom message after submit.    A “Thank You” page for a survey is a great example.    Other times in request forms people want to show a confirmation or instructions page.

    Thankfully the SharePoint product team made this easy for us developers.

    Action Steps

    1. Visit the list or library you’d like to tweak
    2. Click on New item to get to /NewForm.aspx
    3. Take a close look at the URL and notice the word “Source=”
    4. We’ll come back to this in a minute
    5. To create a “ThankYou.aspx” page I like to duplicate the “DispForm.aspx” by going into SharePoint Designer
      1. Right click Copy on DispForm.aspx
      2. Right click and Paste
      3. Edit the file to remove the main web part
      4. Rename the file to “ThankYou.aspx”
    6. Edit the part after the equals sign (=) from #3 and replace with a URL you’d like to take people to after submit

     

    Often the destination page for #5 above doesn’t yet exist.   So you’ll want to open SharePoint Designer 2007 and create a new ASPX page to hold a “Thank You” message.    For this I always place the ASPX file in the same /Forms/ folder as the list I’m working on.   

    Why?    By placing a custom ASPX in the same /Forms/ folder it will be including in any List template (.STP) creation and is easier for future admin and dev staff to locate for troubleshooting.

     

     

    image

     

    image

     

    image

     

    image

    image

     

    image

     

    image

     

    image

     

    image

     

    image

     

    image

     

    image

    MOVIE – Random Tip – XSLT

    So you want to display a single random item from a SharePoint list?     It’s a common request and a very handy one for visitors.    Give your site a fresh relevant appearance with a dynamic web part.    Web 2.0 requires us site designers to keep pace with visitor expectations.   Let’s get to the fun part.    Here we’ll be using the Data Form Web Part (DFWP) sometimes called the Data View Web Part (DVWP) to present a SharePoint list with XSLT logic for the randomizer and conditional formatting to only show the target record.

    Example Code   (random row XSLT.txt  1KB)
    Sample Data     (Email Security Tips.xls  13KB)

     

    Watch this 4 minute movie clip to see a live demo.     Steps are outlined below also.

     image

     

    1. Create your list
    2. Open the target page in SharePoint Designer 2007
    3. Open Data View Manage Data Sources
    4. Ctrl+Click the Title and Body columns     (NOTE – other column names work too)
    5. Drag them on the page
    6. Add two CSS classes to the page header
    7. Locate the XSLT header with “<xsl:variable” entries and confirm you have the below three:
       
       
      
    8. Locate the <TR> for starting a new row.   Add the conditional pair below to apply the right CSS class when needed.
      
           
              showMe 
           
           
              hideMe 
          
    9. Apply extra formatting  (bold, colors, icons) to achieve a unique look for your audience.

    JQuery Accordion – Expand Collapse All

    I looked over many threads and posts on many sites and wasn’t able to find code that worked for me.    Some of it would be close.   Others buggy.   Below I’ve outlined the JQuery code that worked perfectly for my needs and I hope you find it helpful too.

    This example was deployed to a SharePoint page so the “/_layouts/images/plus.gif” was used to leverage the OOTB graphics for a plus/minus icon feel.

    Full Example Source Download     (accordion.zip  73KB)

     

    image

     

    image

     

    Parent .HTML

    Expand All

    First Header

    first body

    Second Header

    second body

    Third Header

    third body

    Supporting .JS

    // bind to accordion object
    $(document).ready(function(){
    	$('#container').accordion({
    		header: “h3?
    	});
    });
    // actions taken upon clicking the expand all (collapse all) link
    $('#container #expand').click( function() {
    	// if link was expand then show and toggle text
    	var currHTML = $('#container #expand').html();
    	if (currHTML.indexOf(“Expand All”)>0) {
    		$('#container .section').slideDown();
    		$('#container #expand').html(“ Collapse All”);
    	} else {
    		// if link was collapse then hide and toggle text
    		$('#container .section').slideUp();
    		$('#container .section').each(function(i){
    			if (i==0) $(this).slideDown();
    		});
    		$('#container #expand').html(“ Expand All”);
    	}
    });

    Could not find the file Exportsettings.xml

    Could not find the file ‘C:WINDOWSTEMPf611fafc-73d8-4b48-bc1e-f9ef6d7cb991Exportsettings.xml’

    This error message comes up when performing a SharePoint Designer 2007 site export and import above 25 MB.     There are some helpful blog articles already written on this like farhanfaiz’s post with a sample XML file with cabsdk workaround.     And this Technet post encourages server side changes to allow for larger files.    However, you might find yourself like me without server access and unable to resolve the issue.

    Backup Steps

    • Open SharePoint Designer to the source site
    • Click [ Site Administration Backup Web Site ]

    image

    • Provide a local file name to save output
    • Do not trust the success message.  If your site was over 25 MB it actually just failed.   Delete the CWP file, it’s worthless.    image

    image

    • Browse to the site’s Recycle Bin and restore all of the files with a crazy GUID number prefix

    image

    • Open the site’s root folder in SharePoint Designer
    • Highlight these GUID files, right click Publish, and send them to your local file system

    image 

    • Create a New Folder on the local file system
    • Extract the content of all the CMP files to this folder
    • Use [ CABARC N newfile.cmp *.* ] to build a single large CMP file
    • This new CMP file contains all of the files of the disparate ones.    It’s easy to manage and provide a reliable import mechanism.
    • If restoring to another MOSS farm first move this new CMP file to that remote machine

    image

     

    Restore Steps

    • Open SharePoint Designer to the target site
    • Click [ Site Administration Restore Web Site ]

    image

    • Browse for [ newfile.cmp ]
    • Enjoy seeing the restored files in the target site’s home folder
    • Go open a cold beer!    image

     

    NOTE:   You can also use [ STSADM -O IMPORT -URL FILENAME newfile.cmp ] for the restore if you have console access on the destination MOSS server.

     

    NOTE:   If the target MOSS farm lacks Feature Definitions (SPFeature) the source had activated the import will fail.   To resolve you can:

    1. Install the features
    2. Open the Manifest.xml and Requirements.xml inside of the CMP to remove those references with Notepad.    Re-create the CMP with CABARC and then run the import again.
    Return to Top ▲Return to Top ▲