Tuesday, January 22, 2013

Error- Exception from HRESULT: 0x80131904

Error- Exception from HRESULT: 0x80131904

Possible solution:
This is caused by an index on a column that no longer exists. 
There is an index on a column – that needs to be removed.

Friday, January 11, 2013

Link to New Form in InfoPath Library

Build this url:

http://{server}/_layouts/FormServer.aspx?xsnLocation=http://{fullpath to the library}/forms/template.xsn?DefaultItemOpen=1



Tuesday, January 8, 2013

Calculated Column to Show only Year

Formala:

=''" &YEAR([DateColumn])
=””& is used to remove the commas from the year

Make SharePoint Column read-only javascript

<script type="text/javascript">
function getTagFromTagNameAndTitle(tagName, title) {
  var tags = document.getElementsByTagName(tagName);
  for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title) {
      return tags[i];
    }
  }
  return null;
}
function GetParentByTagName(parentTagName, childElementObj)
{
var parent = childElementObj.parentNode;
while(parent.tagName.toLowerCase() != parentTagName.toLowerCase())
{
parent = parent.parentNode;
}
return parent;
}
function GetFieldRow(fieldLabel)
{
var nobrs = document.getElementsByTagName("nobr");
var strValue ='';
for(var i=0; i < nobrs.length ; i++)
{
  strValue = nobrs[i].innerText;
  strValue = strValue.substring(0,strValue.length-2);
  if (strValue == fieldLabel)
  {
    var tr = GetParentByTagName("TR", nobrs[i]);
    return tr;
  }
}
}
var ctrl = getTagFromTagNameAndTitle('input','Name of the column you want to make Read Only');
ctrl .disabled  = true;
_spBodyOnLoadFunctionNames.push("StartUpCustomScript");
function StartUpCustomScript()
{
        ChangeOkButtonOnclickEvent("Input","SaveItem");
}
function ChangeOkButtonOnclickEvent(tagName, identifier)
{
    var len = identifier.length;
    /*find all Input type controls on page (ie. control with tag <Input/>)*/
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++)
     {
        var tempString = tags[i].name;     
        /*find any Input type controls on page has its name ending with 'SaveItem'*/      
        if(tempString.indexOf(identifier) == tempString.length-len )
        { 
           /*if found, replace it default onclick with our custom script*/
           var func = tags[i].attributes["onclick"].value.replace("if (!PreSaveItem())",                  
         
          "var ctrl = getTagFromTagNameAndTitle('input',' Name of the column you want to make Read Only ');"+
          "ctrl .disabled  = false;"+
                     "if (!PreSaveItem())");

           /*remove its default onclick event*/
           tags[i].onclick = null;
           /*re-register its onlick event with new script*/
           tags[i].attachEvent("onclick",new Function(func));
        }
    }
    return null;
}

</script>

Monday, December 10, 2012

Error: Error: Attempted to use an object that has ceased to exist

  • The number of columns exceeded in a view
             Create a new view using:

              siteurl/_layouts/ViewType.aspx?List=ListID     
  • corrupted web part
               Add ?contents=1 to go to the maintenance page and delete the unwanted web part from the page.
                 

 

Thursday, December 6, 2012

Differences between Task List and Workflow Task List

Task List:
Use the Tasks list to keep track of work that you or your team needs to complete. 
By default it doesnt send email to the assignees.

Workflow Tasks:
This system library was created by the Publishing feature to store workflow tasks that are created in this site. 
By default it Send email to the assignees.

To change the default setting:
Advanced Settings> Uncheck the send email option.

Nintex 2010: In-Line Functions

In-line Functions used in Nintex 2010 Regular expressions
fn-AbsReturns the absolute value of a number.
Example
fn-Abs({WorkflowVariable:Number})
Arguments
Number The number to return the absolute value of.
fn-Currency
Represents a numeric value as a currency formatted text.
Example
fn-Currency({WorkflowVariable:Cost})
Arguments
Number A variable containing a numeric value.
fn-DateDiffDays
Determines the number of days between two dates.
Example
fn-DateDiffDays({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})
Arguments
Start date The starting date and time to calculate the difference between.
End date The end date and time to calculate the difference between.
fn-DateDiffHours
Determines the number of hours between two dates.
Example
fn-DateDiffHours({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})
Arguments
Start date The starting date and time to calculate the difference between.
End date The end and time date to calculate the difference between.
fn-DateDiffMinutes
Determines the number of minutes between two dates.
Example
fn-DateDiffMinutes({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})
Arguments
Start date The starting date and time to calculate the difference between.
End date The end and time date to calculate the difference between.
fn-DateDiffSeconds
Determines the number of seconds between two dates.
Example
fn-DateDiffSeconds({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})
Arguments
Start date The starting date and time to calculate the difference between.
End date The end and time date to calculate the difference between.
fn-FormatDate
Represents a date time value in text of a specific format.
Example
fn-FormatDate({WorkflowVariable:MyDate}, d)
Arguments
Date A variable containing a date value.
Format string Text describing how the date time value should be formatted. Information on how to format the value can be found on this page: Standard Date and Time Format Strings and this page Custom Date and Time Format Strings.
fn-Insert
Adds text in to a larger string.
Example
fn-Insert({WorkflowVariable:Text}, 4, {ItemProperty:Title})
Arguments
Text The text to modify.
Start position The character position to insert the new text at. The first character in the string is at position 0.
New text The additional text that will be added at the start position.
fn-Length
Returns the number of characters in a string.
Example
fn-Length({WorkflowVariable:Text})
Arguments
Text The string to count the characters of.
fn-Max
Returns the greater of two numbers.
Example
fn-Max({WorkflowVariable:Number1}, {WorkflowVariable:Number2})
Arguments
Number 1 The first number to compare.
Number 2 The second number to compare.
fn-Min
Returns the lesser of two numbers.
Example
fn-Min({WorkflowVariable:Number1}, {WorkflowVariable:Number2})
Arguments
Number 1 The first number to compare.
Number 2 The second number to compare.
fn-NewGuid
Generate a globally unique identifier.
Example
fn-NewGuid()
fn-PadLeft
Returns the provided string right aligned and padded to the total length with a specific character.
Example
fn-PadLeft({WorkflowVariable:Text}, 6)
fn-PadLeft({WorkflowVariable:Text}, 6,-)
Arguments
Text The string to pad.
Length The target total length of the padded result.
Character Optional. The character to pad the original string with. A space character is used by default.
fn-PadRight
Returns the provided string left aligned and padded to the total length with a specific character.
Example
fn-PadRight({WorkflowVariable:Text}, 6)
fn-PadRight({WorkflowVariable:Text}, 6,-)
Arguments
Text The string to pad.
Length The target total length of the padded result.
Character Optional. The character to pad the original string with. A space character is used by default.
fn-Power
Raises a number to the specified power.
Example
fn-Power({WorkflowVariable:Number}, {WorkflowVariable:Power})
Arguments
Number The number to raise to the power.
Number The power to raise number to.
fn-Remove
Removes a section of text in a larger string.
Example
fn-Remove({WorkflowVariable:Text},xxx,{ItemProperty:Title})
Arguments
Text The text to modify.
Start position The character position from which to remove the following characters. The first character in the string is at position 0.
Length Optional. The number of characters from the start position to remove. All remaining characters will be removed by default.
fn-Replace
Replaces a section of text in a larger string.
Example
fn-Replace({WorkflowVariable:Text},xxx,{ItemProperty:Title})
Arguments
Text The text to modify.
Old value The text to search for and replace.
New value The text to replace Old value with.
fn-Round
Rounds a decimal value to the nearest integer.
Example
fn-Round({WorkflowVariable:Number})
Arguments
Number The decimal number to round.
fn-SubString
Extracts a portion of text from a string.
Example
fn-SubString({WorkflowVariable:Text},5,10)
Arguments
Text The text to extract a value from
Start index The position in the text of the first character to retrieve. The first character in the string is at position 0.
Number of characters The number of characters to retrieve from the start index.
fn-ToLower
Formats text in a string to all lower case.
Example
fn-ToLower({WorkflowVariable:Text})
Arguments
Text The string to convert to all lower case.
fn-ToTitleCase
Formats text in a string to title case.
Example
fn-ToTitleCase({WorkflowVariable:Text})
Arguments
Text The string to convert to title case.
fn-ToUpper
Formats text in a string to all upper case.
Example
fn-ToUpper({WorkflowVariable:Text})
Arguments
Text The string to convert to all upper case.
fn-Trim
Removes leading and trailing whitespace from a string.
Example
fn-Trim({WorkflowVariable:Text})
Arguments
Text The text to remove leading and trailing whitespace characters from.
fn-XmlEncode
Encodes a string to make it safe for viewing in html.
Example
fn-XmlEncode({WorkflowVariable:Text})
Arguments
Text The text to encode.
fn-XmlDecode
Decodes a html safe string to regular text.
Example
fn-XmlDecode({WorkflowVariable:Text})
Arguments
Text The text to decode.

                                                Source: Nintex Connect