Tuesday, 7 July 2015

Date formula in SharePoint calculated value

In this article I want to show you to get the next 3 years date based on the today’s date, without using Script we can do it simply using the Calculated Value.

We are having a list with name “Date” with Column “Next3Years” and created the calculated value as shown below with settings.

=DATE(YEAR(Today)+3,MONTH(Today),DAY(Today))


We also change X years instead of 3 years based on your requirement.
While Creating new item we can able to see the column as shown below, if we want to change the date we can able to change and save the  item without any issues.
Finally it looks as shown below.




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Import values from Excel to SharePoint list using PowerShell


In this article we can able to see how to import values from Excel to SharePoint List.

In our scenario we are having a list “VirtoSoftware ” having a TOP 5  Third party we parts(VitroSoftware is a  company  they design and builds innovate we parts for Microsoft SharePoint)  instead of entering manually using Power Shell we can do it easily.

This is the Excel and the list, Excel having the Information but list is having no items.
Now I am running the below PowerShell Script as show below.
Add-PSSnapin microsoft.sharepoint.powershell
$excelinfo = Import-Csv -Path "D:\VirtoSoftware.csv" -Header("Title")
 $web = Get-SPWeb http://virtosoftware.com/sites/topwebparts
$list = $web.Lists["virtosoftware"] write-host $list
foreach ($row in $excelinfo) {
    if($row.Title -ne "" -and $row.Title -ne $null)
    {
    $item = $list.Items.Add();
    $item["Title"] = $row.Title;
          $item.Update();
      }
}
 Once it’s completed finally we can see the OUTPUT


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Friday, 26 June 2015

How to keep Select as default value using JQuery in SharePoint

I am having a list name “Required” with two columns “Title” and “Country”, Country is required field I want to keep default value as “Select” in the Drop down and also it has to throw message as required field when the user is trying to save the item  if the default value is “Select”.

Refer the Two JS file from the internet.
jquery-1.11.0.min.js and jquery.SPServices-2014.01.min.js

<script language="javascript" type="text/javascript">
$(document).ready(function()
{
$('select[title^="Country"]').prepend('<option selected ="selected"
value="">Select</option>');
$('select[title^="Country"]').eq(0).selectedIndex = 0;
$('select[title^="Country"]').val('');
});
</script>


Copy the code in Text file and load it in Site Assets.
Refer the script path in the NewForm.aspx page by edit the page and place the content editor refer the script path in the Content Editor.
Finally it will work as shown below.
  




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Thursday, 25 June 2015

Enable link to item other than Title Field in SharePoint

To enable a link to the item and link to the item with edit menu other than the Title Field in a SharePoint.

We are having list name “Hyperlink” having two field Title and Hyper, now I want to add the Link to Hyper Field .
Using SharePoint Designer we can do it easily.
The following steps we have to follow.
Edit the List in SharePoint Designer
Click on “AllItems” View.
Foe my list having only default view, we can implement the same thing for different views also.
Add the Code as per the below screen shot.








Click on Save in Designer
Now we can able to see the Link in SharePoint UI.

OutPut Looks as shown below:





SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Tuesday, 16 June 2015

Sorry, something went wrong the content type is in use


When we tried to delete a content type, we are getting an error “Sorry, Something went wrong the content type is in use”.
So we prepared a PowerShell script to get the list of places we used the content type in the site collection level and its sites/sub sites

Add-PSSnapin Microsoft.sharepoint.powershell
$site = Get-SPSite("http://dotnetsharepoint.com/sites/sharepoint2013");#enter your site collection URL
foreach ($web in $site.AllWebs) {
    $contypes = $web.ContentTypes["your content type name"]#enter your content type name
    foreach ($ctype in $contypes) {
        $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages(
$ctype)
        foreach ($usage in $usages) {
        Write-Host $usage.Url
        }
    }
}

Finally in the Output, we can able to identify the list if place we used the content type, so if you don’t want to use this content type anywhere, delete it first in the usage url location, then finally delete at site collection level.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Saturday, 13 June 2015

Unable to customize Discussion Board in SharePoint2013

We tried to edit the default “Subject view” for Discussion Board  list in SharePoint 2013, but Modify view is in Disable mode option.



If we want to enable this option, go to "SharePoint Designer" open the Particular site and list that you want to enable the view. Click on the Subject View

In the Designer we can able find the code ReadOnly = “True”, change it to “False”.
Click on save.
Now we can able to see the option to modify the view in the SharePoint GUI.



SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Wednesday, 3 June 2015

The Column name that you entered is already in use or reserved choose another name

when I am working on creating a multiple list content types with same column names suddenly I got a message while trying to create "The Column name that you entered is already in use or reserved choose another name" as shown in the screen shot below

Then I found that there is JavaScript to allow the site columns with same name with different content type.


javascript:g_FieldName={};alert('Successfully cleared column Names');

Copy the code and paste in browser, where ever we got the issue->Hit Enter
Now we can able to see the same message, click ok

Finally keep the script same in the browser and click Ok to create a column.
Now we are able to create columns with same if another content type without any issues.
  
Please let me know, if any one facing the same issue.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM