Archive for the 'SharePoint Designer' Category

08
Sep
11

SharePOint Designer 2010 Workflows Still Process Out of Order

One of the issues with SharePoint 2007 workflows was the actions within a workflow could process out of order due to the asynchronous nature of the workflow processing.  In order to work around these “race” conditions you had to put a checkpoint or commit in your workflow.  This usually means you put a pause in your workflow to make the workflow serialize and de-serialize in the database, thus causing a commit to occur.

The same issue exists with SharePoint Designer 2010 workflows.  I just had an “update list item” action update the incorrect list item, even though it was specified with a unique key.  In many of my workflows I create a name/value pair list that stores values I need to pass around.  In this case I had a “LastMonthProcessed” entry and a “MonthlyControlsListURL” entry.  Each time I updated the “MonthlyControlsListURL” key the value would end up in the “LastMonthProcessed.”  After putting a 1 minute delay (pause for duration) action after the update of the “LastMonthProcessed,” all of the updates occurred correctly.

image

You’d think some clever MS programmer would fix this issue once and for all…or they would a least give you a commit action in SPD.  Arghhhhh!

03
Dec
10

Conditional Formatting and date comparisons with SharePoint Designer 2010

So here’s a fun one that we at SharePoint Rx were struggling with the other day. 

We were creating a dashboard using the DVWP in SharePoint Designer 2010 and had to perform some date comparisons to control the display of indicators.  If you’ve used SPD in the past, you know that the goal is to NOT write code, but to use the “coding by clicking” capabilities of SPD and allow it to write the code (in this case XSL) to control your conditional formatting.  Every time I use SPD for something like this, I always seem to run into a new problem, even though I know it should be a simple task. 

“Am I the only one with this issue?” he asks.

Here’s the end goal…to display a status indicator for tasks to indicate whether they were completed on time, completed late, not complete and not late, and not complete and late.  You can see the four icons I chose to indicate these statuses. 

image

My “conditions” are as follows:

clip_image001 Status equals “completed” and Due Date >= Completed Date

clip_image002 Status equals “completed” and Due Date < Completed Date

clip_image003 Status not equals “completed” and Due Date >= [Current Date]

clip_image004 Status not equals “completed” and Due Date < [Current Date]

One of the issues you immediately experience is the comparison of date values.  Using SPD, I did an “un-advanced” comparison in my condition statements and never got the correct results.  SPD wrote some XSL like this (I broke it up so it’s a little easier to read):

<xsl:if test=”normalize-space($thisNode/@Status) = ‘Completed’

and

ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) &gt;=
normalize-space(@Completed_x0020_Date)” ddwrt:cf_explicit=”1″>

<img src=”_layouts/images/kpinormal-0.gif” width=”16″ height=”16″ />

</xsl:if>

So we have a “Due Date” that has been operated on by ddwrt:DateTimeTick (see if you can find any documentation on this function) and is returning the number of days from January 1, 1900 comparing to the “Completed Date” in the form “MM/DD/YYYY.”  That doesn’t work!

Sidebar rant…Come on, Microsoft!  The only documentation on the ddwrt namespace is from a non-MS person (Serge van den Oever ) and is from 2005…for SharePoint 2003?

So, let’s look at the “Advanced” condition criteria that does work.

image

We used the completely undocumented ddwrt:DateTimeTick function and applied it equally to both dates.

image

When performing the comparison with [Current Date], here’s what we did.

image

We were successful with using the $Today variable, but I’ve seen others who have also used ddwrt:Today.

image

Here are the criteria for all four conditions.

@Status = ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@DueDate))) >= ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Completed_x0020_Date)))

@Status = ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@DueDate))) < ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Completed_x0020_Date)))

$thisNode/@Status != ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) >= ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))

$thisNode/@Status != ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) < ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))

Now, I’d like to believe that features in SPD 2010 that were in SPD 2007 were all functioning correctly, but I seem to have lots of problems using the “All formatting visible” functionality.  I found that each time I changed this I must

  • Save the page
  • Press F5 to refresh (sometimes more than once)

Not sure what that’s about or if it’s just one of my settings, but it sure is annoying.

image

Of course, the idea is that you want to make all your conditionally formatted elements visible so you can easily work on them.

image

FYI, if you want to determine which condition applies to which element, you can select the condition and you should notice a highlighting of the element to which the condition corresponds. 

image

Keywords:

Conditional formatting

SharePoint Designer 2010

Date comparison

Data view web part

ddwrt namespace

15
Oct
10

Can’t Edit Page Layout in SharePoint Designer 2010

Are you having issues opening a page layout in SPD 2010 for editing?  Is everything highlighted in yellow?  John White has a good explanation of what your problem probably is.  You need to edit the file in Advanced Mode.  What’s Advanced Mode?  It’s opening the file so you can really edit it instead of opening it in a mode where you can’t edit it…even though you clicked on Edit File.  Perhaps it should be called "Really Edit the FIle"  (That was supposed to be tongue-in-cheek humor).

What’s interesting is sometimes you’ll be asked if you want to open the file in Advanced Mode and other times the file will open in "read only" (yellow) mode.  Call me old fashioned, but when I click Edit File, I intend to edit the file.

image

Right-click the file and select "Edit File in Advanced Mode."

image

Or, with the File Information screen displayed, select the Edit File drop-down and click on "Edit File in Advanced Mode." 

image

Either way, you’ll be able to edit the file, as you probably intended to do in the first place.

 

Search Keywords:

Can’t edit file in SharePoint Designer 2010

Can’t edit page layout in SharePoint Designer 2010

Page is locked for editing in SharePoint Designer 2010

After copying and pasting a page layout it can’t be edited

Edit File in Normal Mode vs. Edit File in Advanced Mode

16
Apr
10

SharePoint Designer 2007 and 2010 Co-habitating on the Same Computer

I’m wondering if others who have SPD 2007 and 2010 on the same client computer are seeing this happen each time 2007 is started.

image

Since you can’t use 2010 to edit 2007 sites, this seems like it’s going to be a pretty standard configuration on many people’s computers.  Especially for those of us supporting many clients!




Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

February 2012
M T W T F S S
« Sep    
 12345
6789101112
13141516171819
20212223242526
272829  
Support Wikipedia

Follow

Get every new post delivered to your Inbox.