Hi, I just want to show a quick solution to add metadata to a document. There are many ways to get this job done. One option is to use default Settings for folders. This option has some limitations, we will discuss later.
Sometimes you want to make parts of your form available for a certain logged in user or the opposite you want to hide some parts of your form for a special user.
In my case I want to test if a certain person field equals the current logged in user and if it is true I want to display some extra stuff.
There are only 3 Steps left to achieve your goal:
Add two lines under <xsl:param name=”dvt_apos”><xsl:param name=”UserID” /> <xsl:param name=”LogonUser”/>
Add two lines to your ParameterBinding<ParameterBinding Name=”UserID” Location=”CAMLVariable” DefaultValue=”CurrentUserName”/> <ParameterBinding Name=”LogonUser” Location = “ServerVariable(LOGON_USER)” />
Now use some code to decide if current user is equal to a certain person field and do some stuff. Change @MyPersonField to your needs.
<xsl:choose> <xsl:when test=”contains(@MyPersonField, $UserID)”> Display Current Logon User ID: <xsl:value-of select=”$LogonUser”></xsl:value-of> Display Current Logon User Name: <xsl:value-of select=”$UserID”></xsl:value-of> </xsl:when> <xsl:otherwise> … do other stuff … </xsl:otherwise> </xsl:choose>