SharePoint dataview with attachments

Use these codesnipts to show attachments in dataview:

You can place these wherever you want to show the files.

<xsl:element name=”SharePoint:AttachmentsField”>
<xsl:attribute name=”runat”>server</xsl:attribute>
<xsl:attribute name=”FieldName”>Attachments</xsl:attribute>
<xsl:attribute name=”ControlMode”>Display</xsl:attribute>
<xsl:attribute name=”Visible”>true</xsl:attribute>
<xsl:attribute name=”ItemId”>
<xsl:value-of select=”@ID”/>
</xsl:attribute>
</xsl:element>

how to change defaut text of the StatusNote

In mysite you have a statusnote with the default text “What’s happnig” and users need to add the data in this field. How to change the text. There are different methord to change but i will use one of the easyest.

open your master page in SPD:

add these scripts under the statusnotescontrol

<script type=”text/javascript”>
var whats = document.getElementById(“IdentityStatus_ctl00_PlaceHolderMain_ctl02″).childNodes[0];
if (whats.innerHTML == “What’s happening?”)
whats.innerHTML = “custom text here”;
</script>

 

Impersonation Step in SharePoint Designer 2010

While using Workflows in SharePoint designer 2010, I wonder what an Impersonation step does. Impersonation Steps are placed in the workflow in the same way that we would use regular steps. They have conditions and actions within, just the same. But the difference is the actions within the Impersonation steps will run as if it were the identity of the user who authored the workflow.

That means: Using this feature gives the users of the workflow rights they wouldn’t normally have. They may be able to obtain list items actions to a list they don’t have rights to.

Some action in SharePoint designer just runs under the elevated privileges of the Impersonation Step. For example “Check list item permission levels” and “Check list item permissions”.

Scenario 1: You have 2 lists. User adds some information in list A and you want WF to create/update some list items in list B without using user’s permission to list B. If user doesn’t have permission to list B, the workflow will fail. By using Impersonation steps you can solve this issue. Workflow will add information in list B even user don’t have access.

Senario 2: You want to remove permission to an item or a document when these are created automaticly. Using the impersonation steps we can add an action called “Remove list item permission” and “Replace list item permission”

Approval Workflow not rejects the process

While creating a Workflow “Start approval process” from the SharePoint Designer I got some major error where the Workflow don’t reject the reply from the users and just jump further to the next step. Isn’t that some wrong, while I am using if-else branch where I want workflow to find out either the threat is approved or not. If not do something and if reject don’t do anything. In my scenario it will not hit the Reject process cos to reject is not activated. In my post I will show how to set the Workflow to be trigger for the reject process too.

Add workflow “Start approval process” in SharePoint designer

Add action “Set workflow variables”.

Choose CancelonRejection to Yes.

Now the approval workflow makes sense.

Error creating a Database Source to SQL in SharePoint Designer 2010

May be you have tried to create a SQL Database Connection in SharePoint Designer 2010 and receive the message:

Server Error:  An error occurred while retrieving the list of databases from (SQL Server): An authentication error occurred. Your logon information may be incorrectly entered, you may not have permission to access this data source, or the requested authentication method may not be supported. Contact the server administrator for more information.

Ok, lets find Administrator. The first thing dropped in my mind is, I am administrator, who i can contact then?

The solution is very easy.

Go to SQL – Right click the SQL-instance – Properties – Security – SQL server and Windows autentication mode – Ok – Right click again SQL instance – Restart – Yes -Yes.

Now lets find the Administrator?