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

Friday, 11 July 2014

Redirecting to a page from a list form button through SharePoint Designer

There are times when you want to redirect to a different page after adding a new item in a list. Here I have done this by creating a new list form and editing the default close/save button using SharePoint Designer. The steps are as below

  • Open the list in share point designer and create a new list form 


set the new form as default list form


  • Edit the form in advance mode.
  • If you want to redirect Close button URL, Search for SharePoint:GoBackButton. Delete the default close button and insert SharePoint form action button from the ribbon bar.  



 select navigate to the page from action list and click settings to specify your URL. If you take a look at the  code behind of the button you will see the following:
                        
<input name="close1" type="close" value="close" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={Test.aspx}')}"
  • If you want to redirect Save button URL, Search for  SharePoint:SaveButton. Delete the default save button and insert SharePoint form action button from the ribbon bar.  Select Commit and Navigate to page (in this order). Select the Navigate to page (right side) and click settings to specify your home page. 
          If you take a look at the code behind of the button you will see the following:   
  <input name="save1" type="save" value="save" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={Test.aspx}')}"
  • Save and Test

Wednesday, 14 May 2014

How to change the url of a document library in SharePoint

When you create a document library in SharePoint, normally both name and url will be same. If you put any space in the library name, that makes you trouble in url. In that case if you want to change the url,
  1. Login as site collection admin.
  2. Open the site in SharePoint Designer
  3. Locate "All Files" from left hand navigation pane, which will open all folders in your site on the right.
  4. Right Click on the list that you want to change the URL/Web Address for and choose "Rename"
Renaming the library will not make any change to the attached workflow, the Workflow history as well as version history will update with new url.

However, we have to re-save the List Title/Description/Navigation settings because the left nav link did not get updated. Open the new library url in browser. Go to library settings, click on List name ,description and navigation and do save.

Hope this helps..

Thursday, 8 May 2014

An exception occurred when trying to issue security token: There was no endpoint listening SharePoint 2013

Recently I got stuck with the below issue while publishing workflow. When I checked the Event viewer got the following Error.

"An exception occurred when trying to issue security token: There was no endpoint listening athttp://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas that could accept the message. This is often caused by an incorrect address or SOAP action ."
The issue is generally caused by the service application is not provision, and the application pool for the service application is not running.
To fix the issue, please follow these steps:
  1. Open Internet Information Manager(IIS)
  2. Go to "Application Pools"
  3. Select "SecurityTokenServiceApplicationPool", ensure its status is "Start".
  4. After that, open "SharePoint 2013 Management Shell". Run the following command:
     
    $sts = Get-SPServiceApplication | ?{$_ -match "Security"}
    $sts.Status
    $sts.Provision()
      
  5. Do IISReset

Tuesday, 15 April 2014

How to login with different user in SharePoint designer

To start SharePoint Designer 2013 as another SharePoint user, Start the Spedesign.exe process by using a different user account. Steps to do this.

1. Go to the SharePoint Designer 2013 installation folder. By default, the folder is installed in the following location:
C:\Program Files\Microsoft Office\Office15
2. Press and hold the Shift key, right-click Spedesign.exe, and then click Run as different user.
3. Type the credential of the user and then click OK.


Wednesday, 19 March 2014

Automatically create Items in a SharePoint Library using a SharePoint Designer workflow

There might be some requirements like create an item automatically in a library/list when an item is added in to a different library/list.

For this create a workflow in SharePoint designer for first Library which creates a new Item on second Library with the given item values and set the workflow to "Start workflow automatically when an item is created". Steps are as follows

Step 1. Add a Create List Item action.


Step 2. Click the “this list” link, and in the dialog box, select the document library to which you attached your custom content type. This will give you two values to fill out, one for the Content Type ID and one for the Path and Name, the latter being a required field in the Document content type.

Step 3. You can add different columns which you want to be auto populated by the column values from first list. For this create the Columns you want in the second list and map with corresponding columns with first list columns as shown in the below screen.

If the selected list is a form library the Content Type ID will be Form, or it is a document library the Content Type ID will be Document.
Step 4. Modify the “Path and Name” value to [%Current Item: Name%]. If you want a word document to be created, just change the value of Path and Name field as [%Current Item: Name%].docx
Step 5. Click OK. Save and publish the workflow.
 
Go back to your SharePoint list that’s associated to workflow you just created and create a new item.  When the Create Item action is executed, a new entry should be created in your second List and columns also auto populated from first list.

Hope this helps..

Friday, 14 March 2014

How to Disable loopback check

Some times we might get 401.1 Access denied error when trying to access the fully qualified domain name (FQDN) of our SharePoint site from the server. To fix this add a registry key to disable the loopback check. There are two options to do this.

By Manually

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Exit Registry Editor.

By Power Shell Command

New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword

Make sure to reboot your server afterwards.
Hope this helps...

Friday, 6 December 2013

A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions. Infopath web service error

"A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions. If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection."

Recently I had come up with this issue when I try to use InfoPath form to submit data to a web service that hosted in my own server. And got the above error while opening the form. Finally I got the steps to resolve this.

Resolution Steps

1. Make sure that 'Allow user form templates to use authentication information contained in data connection files' in Central Admin is enabled

2.  Create a Data Connection Library in your site.

3. Convert the Data Connection to .udcx file as shown in the below picture


4. Give the path to data connection library


Publish the form to the SharePoint site.
Hope this helps...


Tuesday, 3 December 2013

Calculated Column hyperlink to open an InfoPath Form

This is very tricky. Here I need to create a calculated column where I use a Hyperlink image on which, when the user clicks , InfoPath form shall open in browser.

First you simply set the data type of the Calculated Column from Text to Number or Date/time and it will display the link as a hyperlink. Copy and paste the below code and edit the url based on your site and library.

="<a href ='http://{SERVER}/{SITE}/{LIBRARY}/Forms/template.xsn?openin=browser'><img src ='http://{SERVER}/{SITE}/PublishingImages/Applynow.png'></img></a>"

Friday, 29 November 2013

Rename the Add document link of a document library in sharepoint 2010

By using javascript function getelementbyid("idHomePageNewItem") we can change its display text to new text as we want

Open the document library in sharepoint designer. Open Alldocuments.aspx view in advanced mode.

Add the below script at the end of webpart zone
<script type ="text/javascript">
  document.getElementById("idHomePageNewItem-WPQ2").innerHTML="Enter your new text here"
</script>

Thursday, 19 September 2013

How to check a list column value is null in calculated column

=IF(NOT(ISBLANK([Column1])), IF(NOT(ISBLANK([Column2])),
IF([Column1]<=[Column2], "Success", "Failure"),""), "")

“Open with Explorer” tab showing as disabled in sharepoint 2010

Sometimes you might faced below errors when you try to open the documents from library by clicking 'Open with Explorer' tab.

Typical error messages:
  • “Your client does not support opening this list with Windows Explorer.”
  • This is control is currently disabled as shown in below image
Resolution
Make sure that following service is started, by going: Click Start -> Control Panel -> Administrative Tools -> Services.  
Open the Properties of the WebClient Service. choose as start type: automatic . Restart the service . then check the site in IE

hope this helps...

Thursday, 11 July 2013

sharepoint designer workflow email link to list

Most of the workflow end users requirement is, there should be a link to review the workflow item in  their email.
I am just sharing a quick tip to send an email to a sharepoint Item by adding hyperlink to the message body

1.       Add a “Send an Email” action to your workflow. Edit the action to pull up the email configuration dialog.
2.       Select the text and click the “Add hyperlink” button seen below.
When prompted for the address of the link click the string builder button to add the URL

  3.   In SharePoint, go to the form library where your InfoPath forms are stored, and click an existing  InfoPath form to open it in the browser.
  4.   Copy the URL of the InfoPath form. The URL could resemble the following:

http://ServerName/SiteName/_layouts/FormServer.aspx?XmlLocation=/SiteName/LibraryName/Form1.xml&Source=http%3A%2F%2FServerName%2FSiteName%2FLibraryName%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1
 
where ServerName is the name of the SharePoint server, SiteName is the name of the SharePoint site, LibraryName is the name of the SharePoint form library, and Form1.xml is the name of an InfoPath form 
Copy the URL and paste in the string builder window .Remove the shaded portion after
http://ServerName/SiteName/_layouts/FormServer.aspx?XmlLocation=
 
Instead of that add a lookup [%Current Item:Encoded absolute URL%]  as shown below

5. click OK and publish workflow

Now whenever you create a new InfoPath form and save it to the form library, the SharePoint Designer workflow is started, and an email is sent to the recipients you specified for the email in the SharePoint workflow. When a user opens the email and clicks on the link in the email, the InfoPath form opens in the browser.

Tuesday, 2 July 2013

Nested IF Condition in Calculated Column

Assume that you have 3 approvers in a work flow and need to update the item status based on these approvers individual task outcome
1. Approver1_Status
2. Approver2_Status
3. Approver3_Status

You are updating a calculated column Status_Calc  based on approvers status.

And the scenario is if any approver rejects the request the item status need to set as Rejected and if the final approver approves, set item status as Approved

The [Status_Calc] value will be

=IF([Approver3_Status]="Approved","Approved",IF([Approver3_Status]="Rejected","Rejected",IF([Approver2_Status]="Rejected","Rejected",IF([Approver1_Status]="Rejected","Rejected"))))

Hope this helps...

Sunday, 10 March 2013

The Execute method of job definition Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition threw an exception Event ID 6398

The Execute method of job definition Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition (ID 9fb31cc3-1041-407c-bb02-4494e180b7c9) threw an exception. More information is included below.

Data is Null. This method or property cannot be called on Null values.

Resolution
Go to Central Admin - monitoring - review job definitions - job history (left) and change the view (right) to Failed jobs.You can see it is CEID Data Collection which is causing this problem. Click on Failed link
CEIP data collection job-  disable it...

Before doing this make sure the following things
1. In Central Administration, select System Settings
Click Configure privacy options under Farm Management
Under Customer Experience Improvement Program, select ‘No, I don’t wish to participate
Next this needs to be disabled for all web applications, including Central Administration.

2. Select Application Management, then Manage Web Applications
Select the first Web Application in the list and click General Settings
At the very bottom of list, select No in the Enable Customer Experience Improvement Program
Repeat for all Web Applications in the farm.

Friday, 8 March 2013

How to get list of all users in a site collection

In your url just append _layouts/people.aspx?MembershipGroupId=0. This will give you all users from all groups in a site collection.

If Url is http://localhost:9000/default.aspx, try with 
 http://localhost:9000/_layouts/people.aspx?MembershipGroupId=0

Now,If you want to delete a user from site collection, there is remove option in the breadcrumb menu

How to get list of names of webparts on a page

In your url just append contents=1. This will give you all the web parts that are deployed.

For example: if Url is http://localhost:9000/default.aspx, try with http://localhost:9000?contents=1

Now, If any web part makes errors on your page, you can disable/remove from this page



Thursday, 7 March 2013

"Related Content" link in work flow Task form does not open in browser

Below is the step by step procedure for solving the issue

1.Open C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\layouts.
2. Locate the WrkTaskIP.aspx.  Make a copy of the file and Open in sharepoint designer.
3.  Locate the line SPHttpUtility.NoEncode(m_pageDescription,Response.Output); remove this and add below code 
<%
if(m_pageDescription.Contains(".xml"))
{
//Forcing any xml items to open with forms services
SPHttpUtility.NoEncode(m_pageDescription.Replace("http",SPContext.Current.Web.Url+"/_layouts/FormServer.aspx?DefaultItemOpen=1&ClientInstalled=true&Options=DisableSave&XmlLocation=http"),Response.Output);
}
else

SPHttpUtility.NoEncode(m_pageDescription,Response.Output);
}
%>
4. Do save

 hope this helps..

Application Server Administration job failed for service instance. Event ID 6482

There were many issues that require you to clear the share point configuration cache on your servers.

Below is the step by step provided by Microsoft for Clearing Configuration Cache
1. Stop the Windows SharePoint Services Timer service (Found in Windows Services)
2. Navigate to the cache folder
Drive:\ProgramData\Microsoft\SharePoint\Config\<GUID>
There may be more than one  GUID folders
3. Locate the folder that has the file "Cache.ini"
4. Back up the Cache.ini file.
5. Delete all the XML configuration files in the GUID folder
Note : make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
6. Open Cache.ini file in Note Pad, click Select All and Delete. Type 1, and then Save. Close the Note Pad.
7. Start the Windows SharePoint Services Timer service
8. Restart IIS
Make sure that the Cache.ini file in the GUID folder now contains its previous value, not 1.