Posts

(Looping) Timer Workflows Using SharePoint

Timer Workflows It is often a requirement of a Workflow in SharePoint to monitor and respond to various dates such as a start or due date. If the timer is not the main function of a Workflow, it can be created as a separate Workflow to that both can run in parallel with full functionality. Looping Timer Workflows To have a looping timer workflow (eg. send a daily notification/reminder until a specific condition is met), the workflow must start when an item in the list is changed, and when it is created depending on the scenario. At the start of the workflow, test if the required condition has been met, and stop the workflow if it has. If the condition has not yet been satisfied, the workflow can continue. As the workflow will initiate after an item is modified, it is possible for multiple instances of the same workflow to be initiated. To prevent this, a custom (boolean) field is added to the list which is used to determine if an instance of the workflow is already running. When the w...

InfoPath Error - Updating Content Type Failed When Publishing to SharePoint

When Publishing an InfoPath Form to a SharePoint site Content Type, the process may fail when trying to Update the Site Content Type if there are a large number of fields being promoted to SharePoint columns/fields in the Content Type with an "Updating Site content Type Failed" message. One solution for this is to create a separate list with a lookup column/field back to the list which uses the Content Type created by InfoPath. The fields which are removed from the Content Type can be added to the separate list instead. When the InfoPath Form is submitted, rules can be configured to create or update an item in the separate list which corresponds to the form being submitted, with the additional data. How to Solve : 1. Make a full backup the InfoPath Form Template and the SharePoint Site (Content Types, Lists, etc.) 2. Choose which fields to add to the separate list instead of promoting/submitting with the form data. 3. Remove the fields from the list of promoted fields ( ...

InfoPath Tip - Show text field if user selects other

Image
InfoPath Basics - Display text box if user selects Other using conditional formatting Promote two fields to a single SharePoint or Database column/field. This article demonstrates how to configure an InfoPath form to display an optional text box for the user to enter a custom value if not available from the list of options. A separate field in the main data source of the InfoPath form will be used to store the value of the selected option, or the custom value if supplied by the user. Rules are set up to set the value of the separate field in the data source when an option is selected or when a custom value is entered into the text box. When submitting the form, the text field with either the value selected, or the optional text input entered if the user selects other can be promoted to a single SharePoint column, or database table instead of promoting both the option field and the text field containing the "Other" value if selected. Conditional formatting is also used t...

XSLT String Manipulation - Remove spaces in Field Value for use in URL

XSLT function sets the value of a parameter to the value of the required field, after processing to remove spaces. The parameter is then used to set part of url in the href attribute of an <a> tag. <xsl:template name="dvt_1.groupheader0"> <xsl:param name="fieldtitle" /> <xsl:param name="fieldname" /> <xsl:param name="fieldvalue" /> ....... other template params 1. Add a parameter to store <xsl:param name="stringNoSpaces" > <xsl:call-template name="stringreplace"> <xsl:with-param name="stringvalue" select="@Field-XPath" /> <xsl:with-param name="from" select="string(' ')" /> </xsl:call-template> </xsl:param> ....... main template code <a href="/FirstURLComponent/{$stringNoSpaces}"><xsl:value-of select="$fieldvalue" /></a> ....... remaining template code </xsl:...

Custom Publishing Page Layout using SharePoint Designer

Image
Overview: This article demonstrates how to create a customised Publishing Page Layout which can be used to add publishing pages to a SharePoint site with publishing features enabled. The page will be created from a content type which contains additional fields which are to be displayed on the publishing page both when it is being edited and once it has been published. This article also demonstrates how to display fields only when a publishing page is being edited using an Edit Mode Panel if required. 1. Activate Publishing Features on the SharePoint site: 2. Create Publishing Layout Content Type 3. Create Publishing Layout from the Content Type 4. Customise the Publishing Layout using SharePoint Designer 5. Add the Content type to the Pages library on the SharePoint site 6. Create a new Page from The Custom Publishing Layout Requirements: SharePoint (MOSS 2007) SharePoint's Publishing Features SharePoint Designer (2007) SharePoint Designer is now available for Free. Download ...

Solved: Can't Group By Choice Column in SharePoint List View

By Default, items in a SharePoint list can't be grouped by a Choice field if it allows multiple selections (checkbox). To be able to group by the value of a Choice field in a SharePoint list or library which allows multiple selections, you need to ensure that the Choice field/column is set as Radio Buttons or a Drop Down Menu. Both of these options only allow a single selection of the available choices, which is required to allow grouping by the column/field using Standard SharePoint List views. To group by a Choice field which allows multiple selections (checkboxes), convert the Web Part to a Data View using SharePoint Designer, then apply grouping doing the following: 1. From the "Common Data View Tasks" menu for the Data View Web Part, select "Sort and Group:" from the options to open the Sort and Group Dialog, add any field into the Sort Order section to activate the "Edit Sort Expression..." button. Click the "Edit Sort Expression..." b...

InfoPath Form Content Type & Template Version management

How to manage updated versions of InfoPath form templates when used as Site Content Type. The following article demonstrates how to ensure that an InfoPath form created from an older version of the form template continue to load from the template version which they were created from, while any new form submitted to the library will always use the latest version of the form template. This may be required when InfoPath forms are being integrated with SharePoint workflow, as the workflow will be set up to function using data from fields in the most recent version of the form template. If the main data source in the InfoPath form template is updated, the SharePoint Workflow may also need to be updated to cater for any field changes, or additional fields which are required by the workflow. Once the Workflow has been updated to work with the most recent form template version, any new forms submitted to the library will open from the new template, which will then start the updated version of ...

InfoPath: Transfer Data Between 2 Forms

Overview: When added to an InfoPath Form template, the following JScript allows data to be transferred from one form to another programmatically using code executed by the first form. For example, this can allow a set of data from a forms data sources to be extracted and transfered into another form containing similar fields. This can also allow variations, or custom versions of a form template to be sent to specific people who may speak a different language, require an alternate layout or theme, or if the data containined in the form is confidential and needs to be submitted to a secure or different location to other forms of the same type. Alternative Methods for Transferring data between forms (without using code) Requirements: - InfoPath 2007 (can also be acheived using 2003) Process: The step descriptions below have been commented out to allow them to be pasted into the forms code. Additional notes are in blue and have also been commented, but can be ommited if required....

SPD Workflow - Test if value exists in any item in SharePoint list - create new item if not found

SharePoint Designer Workflow: How to test if a specific value exists in any item in a list without the workflow stopping due to a "List item not found" error if no items exist with the required value. When trying to find a list item using the "Update List Item" action or similar in a SharePoint Designer workflow by matching a field which is not always unique (eg. the "Title" column/field), the workflow will stop if the list item is not found with a "List item not found" error. To prevent this, a looping workflow can be used to build a delimited string containing the value from the field being tested, for all items in the list. Instead of trying to test if a specific value exists in any item in a list by testing the required field directly, the workflow can compare the string containing all possible values using a much larger range of useful conditions including "contains", "does not contain", "contains (ignoring case)...

InfoPath Coding Tips - When to use code in InfoPath forms

When should code be used in an InfoPath form and when should it be avoided? There is no simple answer to this question, as it comes down to a matter of personal preference. This article is aimed at reducing the development time for InfoPath forms of various scales. The following are some tips to help you make the right decision. Firstly, I should note that InfoPath is a great tool for creating electronic forms, as many features are provided to including data connections to external sources (Database, SharePoint, etc.), data validation and conditional formatting which allow complex forms to be created and submitted without using any code. I my opinion, as an InfoPath form becomes more complex the efficiency of the form's development is reduced when avoiding using code. This is due to the amount of mouse clicking required to set default values, create rules and apply formmating conditions to individual elements in a data source, or controls on the form template. If code is not a stre...

InfoPath Performance for SharePoint Data Connections

Image
When an InfoPath form has a large number of SharePoint data connections, the time it takes to open a the form will increase resulting in slow loading time when the form is being opened. To reduce the loading time of the InfoPath form, SharePoint list/library Views with filter criteria can be used to minimise the number of results, while ensuring that all required items that are displayed in the result set. [edit] InfoPath Data Connections to a SharePoint list retrieve items from the list's default view. This can lead to the data connection not returning the required result from the SharePoint list if items are filtered or limited. See InfoPath data connection not returning all results from a SharePoint list for details. For instructions in how to create and set up InfoPath data connections to retrieve data from SharePoint lists, see Using Secondary InfoPath Data Connections to retrieve data from a SharePoint List or Library . The challenge when creating views to ignore irrelev...

InfoPath - CAML Date Time format in when submitting to a SharePoint list via a Web Service

I noticed that when trying to update a SharePoint list item using a CAML query from an InfoPath form, if the date/time format was not correct the field in the SharePoint list item would not be updated. Any updates in the CAML query after an element with an invalid date/time format were also not applied. The Date Time format in a CAML query must comply with the ISO 8601 standard. This means that to update the time component of a Date/Time field in a SHarePoint list, the time and date must be formatted according to the ISO 8601 profile. To ensure the time component of the dat/time filed is updated in SharePoint, use one of the the following date/time formats: YYYY-MM-DDThh:mmTZD (2009-07-27T21:20+01:00) (2009-07-27T20:20Z) or YYYY-MM-DDThh:mm:ssTZD (2009-07-27T21:20:30+01:00) (2009-07-27T20:20:30Z) Key Components: The date must be in YYYY-MM-DD format "T" indicates the start of the time the time must be in "hh:mm", or "hh:mm:ss" formats The time must be pr...

InfoPath - Update Repeating Elements/Nodes in a Secondary Data Source

How to update repeating elements/nodes in a secondary data source by attribute: You may have a data source in an InfoPath form which contains repeating elements, each with the same name. When this is the case elements are usually distinguished by an attribute, commonly "name". The value for the name attribute can then be used to identify the specific element in the data source. Example below: <?xml version="1.0" encoding="UTF-8"?> <Batch OnError="Continue"> <Method ID="1" Cmd="Update"> <Field Name="ID"></Field> <Field Name="field1"></Field> <Field Name="field2"></Field> </Method> </Batch> Each "Field" element above corresponds to a field/column in the SharePoint list, specified when connecting to the Lists web service. For details and instructions for setting up InfoPath ...