Search This Blog

Showing posts with label SPList. Show all posts
Showing posts with label SPList. Show all posts

Monday, May 30, 2016

BUSINESS CONNECTIVITY SERVICES in SharePoint 2013

What is BCS?

The short answer is pretty simple – BCS enables you to connect to ‘other’ data sources outside of SharePoint and literally treat them as a SharePoint List.
With BCS, you can bring information into SharePoint from a variety sources. For example, you can bring data from an external SQL Server database, a traditional web service, a WCF service, proprietary systems, and OData services.

How to Implement with SQL External Data Source:

1. Open SharePoint Designer with the required URL:


2. Select the External Types from left menu and click on External Content type from ribbon menu


3. Change the name of External Content type information and select the Item type.


4. Select Click here to discover external data source and define operations.


5. Click Add connection and Choose External Data Source Type:


6. Here we selected SQL server, now we need to provide the Server credentials:


   Once we provided the server and DB details then our DB will be enabled here. As we can see i            have connected my Test DB for BCS.

7. Under our DB we can select any table and we can create operations for that [articular table:
    Here we can create any operation for that table. Here i am creating all operation for that student table

8. Next we will see the Operation properties:



9. Once the operations are created then we need to create an external list for that particular Table:


    Here select the BCS name and click ok.


Give a name for the external list. Once the list is created then we can see that list in our URL under site contents.
If you open that list you may see like this:


10. Open central admin. Under application management click on Manage Service Applications


   Under that we can see Business Data Connectivity Service if you click on that we can see our BCS 


   From that click our BCS and Select on Set permissios:


 There give permissions to corresponding users:


After that it will work. If don't then set Meta data store permissions same as set permission and give the required permissions to the corresponding users then it will surely work.

You can add items in that list which will reflect in that table. 



Thank you...

Wednesday, June 24, 2015

Get Row ID of inserted data in SharePoint list

SPList spList = spWeb.Lists["Announcements"];
SPListItem spListItem = spList.Items.Add();
spListItem["Title"] = "Hello world";

spListItem.Update();
int RowID = spListItem.ID;  //This is the ID of the new item.

Friday, June 19, 2015

How to add Custom validation for Newform.aspx and Editform.aspx in Sharepoint 2013

I am using PreSaveAction() JavaScript function to check whether start day is lower than End day or not. If it is lower than greater than end day then it will show an alert message;

Add in the Content Editor Web Part located under the Media and Content category.

Paste the following code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
 var j = jQuery.noConflict(); 
 function PreSaveAction() { 
 var startDay= j(":input[title='Start_Day']").val(); 
var endDay= j(":input[title='End_Day']").val(); 
if(startDay=='')
{
alert("Please enter start day");
return false;
}
else if(endDay=='')
{
alert("Please enter end day");
return false;
}
else if(endDay < startDay)
{       
   alert("End day should be greater than start day");          
   return false;
}
else{
   return true;
    }
}

</script>

thank you..

How to Disable Quick Edit in SharePoint 2013 Lists


By default SharePoint 2013 lists allow you to quickly edit items by clicking "edit" from the view without opening it.

Now, if you want to disable this function follow these steps:
  1. Go to the list settings> Advanced settings page
  2. Scroll down and Under quick edit options just choose "No" and then click OK.
     3. Now you can see that quick edit is disabled from the list.

Restricting Custom People Picker to only one Sharepoint group programatically

Refer the following script files in your page,     <!-- For People Picker -->     <script type="text/javascript" src...