This article will explain you how to use existing external content types.
Step 1 : Go to Central Admin and click on BDC service under Manage Service Application.
Step 2 : Select existing service and click on Set Object Permission
Step 3 : Add any existing user and set permission as below and click ok.
Step 4 : Go to any of existing web application.
Step 5 : Go to Site Content, click on Add an App and select External List.
Step 6 : Provide Name and External Content Type as per screenshot.
Step 7 : Do IISRESET and Navigate to that External List and you will see external data.
Make Sure MACHINENAME\IUSR has enough permision otherwise you will get "Message from External System : 'Login failed for user 'NT AUTHORITY\IUSR'.'." error.
Thursday, April 25, 2013
Thursday, April 18, 2013
SharePoint 2013 - External Content Types (BCS) - Part 1
This articles will explain you how to configure external content types.
Step 1 : Open any site using SPD(SharePoint Designer)
Step 2 : Click on External Content Types link from left navigation
Step 3 : Click in External Content Type from menu button
Step 4 : Provide Name, Display Name, Namespace etc as per below screenshot.
Step 5: Click on External System Link
Step 6: Click on Add Connection and select Data Source Type as SQL Server.
Step 7 : Provide Database Server Name, Database Name and select "Connect with User's Identity".
Step 8 : Select any Table and right click on it and select "Create All Operations". Finish the wizards.
Step 9 : Steps to create external content type "BCSDemo" are completed.
Step 1 : Open any site using SPD(SharePoint Designer)
Step 2 : Click on External Content Types link from left navigation
Step 3 : Click in External Content Type from menu button
Step 4 : Provide Name, Display Name, Namespace etc as per below screenshot.
Step 5: Click on External System Link
Step 6: Click on Add Connection and select Data Source Type as SQL Server.
Step 7 : Provide Database Server Name, Database Name and select "Connect with User's Identity".
Step 8 : Select any Table and right click on it and select "Create All Operations". Finish the wizards.
Step 9 : Steps to create external content type "BCSDemo" are completed.
Monday, April 1, 2013
SharePoint 2013 - SharePoint Hosted App For Reading All the List From the Host Web Using Cross-Domain Calls
1. Create any sample project using SharePoint App Template
2. Go to Manifest.xml file and give Read permission for List
3. Edit App.js file and replace with given value
var web;
var hostweburl;
var appweburl;
$(document).ready(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { sharePointReady(); });
});
function sharePointReady() {
hostweburl =
decodeURIComponent(
getQueryStringParameter('SPHostUrl')
);
appweburl =
decodeURIComponent(
getQueryStringParameter('SPAppWebUrl')
);
var scriptbase = hostweburl + '/_layouts/15/';
$.getScript(scriptbase + 'SP.Runtime.js',
function () {
$.getScript(scriptbase + 'SP.js',
function () { $.getScript(scriptbase + 'SP.RequestExecutor.js', printAllListNamesFromHostWeb); }
);
}
);
}
function getQueryStringParameter(param) {
var params = document.URL.split("?")[1].split("&");
var strParams = "";
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split("=");
if (singleParam[0] == param) {
return singleParam[1];
}
}
}
function printAllListNamesFromHostWeb() {
var context;
var factory;
var appContextSite;
var collList;
context = new SP.ClientContext(appweburl);
factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
context.set_webRequestExecutorFactory(factory);
appContextSite = new SP.AppContextSite(context, hostweburl);
this.web = appContextSite.get_web();
collList = this.web.get_lists();
context.load(collList);
context.executeQueryAsync(
Function.createDelegate(this, successHandler),
Function.createDelegate(this, errorHandler)
);
function successHandler() {
var listInfo = '';
var listEnumerator = collList.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listInfo += '< li>' + oList.get_title() + '< /li>';
}
document.getElementById("message").innerHTML = 'Lists found:< ul>' + listInfo + '< /ul>';
}
function errorHandler(sender, args) {
document.getElementById("message").innerText =
"Could not complete cross-domain call: " + args.get_message();
}
}
2. Go to Manifest.xml file and give Read permission for List
3. Edit App.js file and replace with given value
var web;
var hostweburl;
var appweburl;
$(document).ready(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { sharePointReady(); });
});
function sharePointReady() {
hostweburl =
decodeURIComponent(
getQueryStringParameter('SPHostUrl')
);
appweburl =
decodeURIComponent(
getQueryStringParameter('SPAppWebUrl')
);
var scriptbase = hostweburl + '/_layouts/15/';
$.getScript(scriptbase + 'SP.Runtime.js',
function () {
$.getScript(scriptbase + 'SP.js',
function () { $.getScript(scriptbase + 'SP.RequestExecutor.js', printAllListNamesFromHostWeb); }
);
}
);
}
function getQueryStringParameter(param) {
var params = document.URL.split("?")[1].split("&");
var strParams = "";
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split("=");
if (singleParam[0] == param) {
return singleParam[1];
}
}
}
function printAllListNamesFromHostWeb() {
var context;
var factory;
var appContextSite;
var collList;
context = new SP.ClientContext(appweburl);
factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
context.set_webRequestExecutorFactory(factory);
appContextSite = new SP.AppContextSite(context, hostweburl);
this.web = appContextSite.get_web();
collList = this.web.get_lists();
context.load(collList);
context.executeQueryAsync(
Function.createDelegate(this, successHandler),
Function.createDelegate(this, errorHandler)
);
function successHandler() {
var listInfo = '';
var listEnumerator = collList.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listInfo += '< li>' + oList.get_title() + '< /li>';
}
document.getElementById("message").innerHTML = 'Lists found:< ul>' + listInfo + '< /ul>';
}
function errorHandler(sender, args) {
document.getElementById("message").innerText =
"Could not complete cross-domain call: " + args.get_message();
}
}
Subscribe to:
Posts (Atom)