Showing posts with label SharePoint Designer. Show all posts
Showing posts with label SharePoint Designer. Show all posts

Friday, April 08, 2011

List View Lookup Threshold

In my workflow I have multiple 'Collect Data from Users' actions configured. It tested with no problems in my dev environment running with an admin account. However, in a separate test environment running the workflow as a normal user the workflow failed with the following error:

SP Workflow Error: An error has occurred in YourWorkflow

I searched the SP logs and found the following ULS error:

Some lookup fields were omitted from the query results because the list exceeds the lookup column threshold. 

The problem occurred because SP has a threshold on list lookup columns set to a default value of 8.

There are two possible solutions:
  1. Increase the threshold in Central Administration

    NOTE: It is recommended NOT to increase the threshold since it will affect performance across your web application.

    However, if you do want to increase the threshold you can do so in the Resource Throttling settings in Central Administration. Here you can "specify the maximum number of Lookup, Person/Group, or workflow status fields that a database query can involve at one time":

    1. Click Manage web applications.
    2. Select the web application you want to update.
    3. Click General Settings | Resource Throttling.


    4. Update the List View Lookup Threshold to at least 12.
    5. Click OK.

  2. Reduce the number of lookup columns in your workflow.

    NOTE - lists / libraries already have two lookup columns by default: 'Created by' and 'Modified by' so while the threshold is set to 8 you need to keep your additional columns to a maximum of 6.

Thursday, April 07, 2011

Hide and auto-generate 'Title' column in SP Designer workflow

I have a custom list content type, which applicants use to apply for jobs. The default 'Title' column is not required as it would make no sense to the applicant. However, I don't want to rename the site column or delete it from the site because it is used in other lists.

The 'Title' column is inherited by lists and libraries from the 'Item' content type. If you don't require it you can specify it's settings to be hidden so that it does not appear in any forms.

To Hide the Title Column:

  1. Open your custom Content Type Information page and select the 'Title' column. 
  2. Set the Column Settings to 'Hidden'. 


To Auto-Generate the 'Title' column Value:

Using SP Designer you can auto-populate the 'Title' column based the values of other columns in your list item using the 'Update List Item' action:


NOTE: When a user creates a new list item the 'Title' will initially be set to '(no title)'.  Associated tasks in the workflow are related to the list item title by SharePoint (for example when collecting data from users). To avoid tasks being related to items with '(no title)' set a 'Pause for Duration' action for 5 minutes in the workflow to allow SP timer jobs to reflect your auto-generated title in the list.

Friday, January 07, 2011

Creating Web Part Pages with a Quick Launch

Web Part Pages in Team Sites by default do not show the Quick Launch left navigation. Basically the panel is hidden by a CSS style written into the page <head>:

<style type="text/css">
body #s4-leftpanel {
 display:none;
}
.s4-ca {
 margin-left:0px;
}
style>


and two placeholders in the <body>, which override the masterpage placeholders:

<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>



To show the Quick Launch open the page in SharePoint Designer and remove the style and the placeholders.

Thursday, February 12, 2009

A theme with the name "CustomMySite 1011" and version already exists on the server.

You receive this error when trying to apply a custom theme to your SharePoint site:

"A theme with the name "CustomMySite 1011" and version already exists on the server. "
  1. Open your site in SharePoint Designer.
  2. Expand _themes and delete the CustomMySite theme folder
  3. Re-apply the custom theme to your site.

Thursday, October 23, 2008

MOSS Page Setting Error - Value does not fall within the expected range

Thanks to these guys for the solution

I found an error when trying to change the Page Settings of a default.aspx in one of my sites today.

I wanted to update the page layout template in use but on selecting Page Settings from either the Page drop down in edit mode or from the Site Content & Structure page i received the follwoing error:

Value does not fall within the expected range
  1. Open the site in SharePoint Designer
  2. Select File / Export and choose the page you are trying to update
  3. Open the page locally using Notepad
  4. Search the source for “mso:PublishingPageLayout"
  5. Look at the path :

    http://mossdev/_catalogs/masterpage/customLayout.aspx, Custom Reports Layout

  6. The string points to my old development environment http://mossdev
  7. Update the path to the live environment eg: http://mosslive
  8. Save the file
  9. In SharePoint Designer select File / Import and choose the modified file
  10. Check the files back in and approve them.
Problem solved - i can now update the page settings with no error.

Wednesday, May 21, 2008

Content Query Web Part - Custom Item Style

  1. Open SharePoint Designer and go to the site Style Library
  2. Open the file: ItemStyle.xml
  3. Copy the following code or one of the existing styles from the XML
  4. Modify the XML as required; for example the code below places an image on the left of a title, in this case used for portal news headlines.
  5. Check in the XML file
  6. Refresh the page you are editing the CQWP on and open the Presentation section of the CQWP edit panel. The new style should now be listed under Item Style.













<xsl:template name="NewsHeadline" match="Row[@Style='NewsHeadline']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="LinkTarget">
<xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
</xsl:variable>
<div id="linkitem" class="item">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}">
<img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
</a>
</div>
</xsl:if>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<strong><a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a></strong>
</div>
</div>
</xsl:template>

Monday, January 14, 2008

Custom Workflow using SharePoint Designer

This comes from: http://metahat.blogspot.com/2006/12/1.html

1.1Scenario:

  • Author creates document and submits the approval request to the

  • Reviewer approves/rejects the document.

    • In case of approval email is sent to author notifying approval

    • In case of rejection email is sent to author notifying rejection

1.2Implementation:

  • Create an sharepoint list with approval enabled



  • Open sharepoint designer 2007
  • Open the desired site for workflow as shown below :
    • Click File ->Open Site
    • Enter the url of the desired site in site name section and press “Open”
    • This will open the site
  • Creating new workflow
    • Click File -> New
    • The “New “ Dialog box will pop up
    • Select “SharePoint Content” tab
    • Select workflow from the list box “Blank workflow”
    • Assign appropriate name to workflow in my case its “Approval workflow”
    • Select the list in sharepoint list to which this workflow should be associated
    • Select the start condition of the workflow
      • Start when item is created
      • Start when iten is changed
      • Manual workflow start up

    • Before we start we will go forward and define some initiation workflow variables .
    • Click on the initiation button
      • Define a variable named “workflowstatus” and set the default value as “notstarted”

1.2.1STEP 1

  • Lets start defining the workflow
    • First define a step name “To Approver”
    • Click conditions button and you will get an drop down


    • Select “Compare any data source” you will get option as shown in figure
    • click on the “value” you will get an input box with an eclipse button like this



    • Click on that “fx” eclipse button
    • You will get dialog box like this with “current item” as default selection
    • change the selection to”Source: workflow data” and in the field section select :Initiation :workflowstatus”

    • Click Ok
    • Now select the “value” field after “equal “ and in the input box fill “notstarted”


    • No we are ready with our condition with says “ If “workflowstatus” variable is equal to “notstarted” then execute the defined action
    • Lets Go forward and put process in our action section


    • select “Set workflow variable”
    • Set the values as shown in fig below



    • Now we have set the workflow variable” workflowstatus”to started
    • Lets send E-Mail to the Reviewer for approval request
    • From the actions Menu select send an EMAIL



      • click on “this message” which will eventually pop up a self descriptive dialog box



      • Fill all the appropriate fields for EMAIL and Email is set
        • To : “Reviewer Email ID”
        • Subject

        • Body
    • After email to reviewer we have to make sure that our workflow waits for “Approval/Rejection ” from the Reviewer
    • In order to achieve a “WAIT” we have to add one more action

      • So click on the actions and select “Wait for field change in current item”
      • Assign values and make condition as shown below

Ie Wait till the “Approval status “ is not either “Approved/Rejected”
  • We are done with our first step where the author has requested an approval and reviewer has received mail of approval request

1.2.2STEP 2

  • In this step we have to take care of 2 conditions “Approved /Rejected “
  • To define seconf step click “Add workflow step “on eight pane of workflow designer
  • The Second step would look like this


  • So define 2 conditions “If approved “ and If Reject “
  • The branching of condition can be achieved using the drop down of activity


  • This will take care of the second step
  • Once the email is send stop the workflow by selecting “stop workflow” from the Action menu , this make stop the workflow and make the workflow status to complete

NOTE: Always make sure to stop workflow in all the implementation, in case its missed the workflow will still be alive in the system and that might lead to server performance degradation