Skip to main content

Using XPath to display only the current Year

Using XPath to display only the current Year
1. Right click your textbox and select properties.
2. For Data Types select Text (string).
3. Select the formula button next to the Value box in the Default Value section .
4. Select Insert Function.
5. Select substring-before (in the Text functions).
6. For the first field, put in the field with the date your want or the function today() for today's date.
7. After the comma, put in "-"
8. Your final formula should look like this: substring-before(today(), "-")

The substring-before function takes all the characters in the first string (today() in our case) up to the first occurrence of the character in the second string (the hyphen, for us). Since today() returns a date formatted as: "2008-07-16", taking everything before the first hyphen returns the year.

Popular posts from this blog

Custom Error Page in SharePoint 2010

You can easily dispaly your own HTTP 404 Page Not found Error page for each of your SharePoint Web Application. A custom Error page can be associated with each Web Application in SharePoint and you can redirect the 404 error page to your own specified error page. SharePoint has it's error Pages stored at this location: 14\TEMPLATE\LAYOUTS\1033\ERRORV4.html 14\TEMPLATE\LAYOUTS\1033\sps404.html The one we need is the sps404.html. If you open this page you will see: STSNavigate("/_layouts/spsredirect.aspx?oldurl="+ requestedurl); Here spsredirect.aspx is the Error page currently used by sharepoint. So what we need to do is, first make a copy of the sps404.html, rename it - in my case mscom404.html and save it at the same location (14\TEMPLATE\LAYOUTS\1033).Now in the STSNavigate replace spsredirect.aspx with your own aspx page. The url in STSNavigate should be a properly working url, then only the redirection will work. as you can see in the code above, i'm placing my e

Tracing service in Windows SharePoint Services

recently i got to know about the SharePoint's Tracing service. Tracing Service is used by Windows SharePoint Services 3.0 to manage trace output. Tracing is usually needed to debug things in SharePoint....if you are not actively and regularly debugging things, you may not need this and can stop the service, as the logs occupy a significant size on the system (.....in GB's). Read more ..

Resolving the Croos-Domain Policy issue while accessing WCF Service in a Silverlight Application

W hile trying to access WCF service into my Silverlight application, i came accross "Cross-Domain" policy issue. As i'm new to WCF service, i didn't know that an access policy file is required. By default, Silverlight supports calls to Web services on the same domain or site of origin. Same domain means that calls must use the same sub domain, protocol, and port. This is for security reasons and prevents cross-domain forgery. You can enable Web services to be called by a Silverlight application in another domain by deploying a Web service that uses the correct cross-domain policy file at the root of the domain. You need to add this crossdomain.xml file to the root of IIS hosted service directory. Read more about Cross-Domain policy here .