https://docs.google.com/open?id=0B2Upnu3UapW9bl9Zc055ZENFYXM
Thursday, October 25, 2012
Tuesday, October 23, 2012
Http 503 Error Service Unavailable in SharePoint 2010
- Go to Run and Type inetmgr
- Go to your Application pools.
- Click on the SharePoint Site with which you are getting the problem.
- Click on Advanced Settings and go to Process Model Tab and select Identity.
- In Application Pool Identity I observe that Custom Account Radio Button is selected.
- Select Built in Account Radio Button & select the Smart Tag under the Radio Button.
- In the Smart Tag select Network Service and press ok.
- Now the problem is solved.
Tuesday, October 09, 2012
Delete the SharePoint ListItem using ECMA Script
Note:-
Use Delete() function in Delete Button onclick event, for DropDown Binding View my Previous article posted before this.
Use Delete() function in Delete Button onclick event, for DropDown Binding View my Previous article posted before this.
function Delete()
{
ExecuteOrDelayUntilScriptLoaded(DeleteRecord,
"sp.js");
}
function DeleteRecord()
{
if(document.getElementById("ddlItemID").selectedIndex==0)
{
alert('Please
Select UserName');
return
false;
}
var
context = new SP.ClientContext.get_current();
var web =
context.get_web();
var list =
web.get_lists().getByTitle('Login');
var LoginRecord =
list.getItemById(document.getElementById("ddlItemID").options(document.getElementById("ddlItemID").selectedIndex).value);
LoginRecord.deleteObject();
context.executeQueryAsync(Function.createDelegate(this,
this.DeleteSuccess), Function.createDelegate(this, this.DeleteFailed));
}
function DeleteSuccess()
{
alert('Record
Deleted Successfully');
document.getElementById("tdItemID").innerHTML="";
Bind();
document.getElementById("ddlItemID").selectedIndex=0;
}
function DeleteFailed(sender, args)
{
alert('Delete
Failed');
}Binding SharePoint ListItems to DropDownList using ECMA Script
Note:-
Use Bind() function in the Page Load. Before that Create a TD with ID tdItemID.
function Bind()
{
ExecuteOrDelayUntilScriptLoaded(BindDropDown, "sp.js");
}
function Bindfailed(sender, args)
{
alert('failed. Message:' + args.get_message());
}
Use Bind() function in the Page Load. Before that Create a TD with ID tdItemID.
function Bind()
{
ExecuteOrDelayUntilScriptLoaded(BindDropDown, "sp.js");
}
function BindDropDown()
{
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list =
web.get_lists().getByTitle('Login');
var
sQuery="<View><Query><OrderBy><FieldRef Name='ID'
/></OrderBy></Query></View>";
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(sQuery);
this.myColl = list.getItems(camlQuery);
context.load(this.myColl, 'Include(Title,
ID)');
context.executeQueryAsync(Function.createDelegate(this,
this.BindSuccess), Function.createDelegate(this, this.Bindfailed));
}
Bind();
function BindSuccess()
{
var listEnumerator = this.myColl.getEnumerator();
var strDropDown="";
strDropDown+="<Select
id='ddlItemID'>";
strDropDown+="<Option>";
strDropDown+="Select Username";
strDropDown+="</Option>";
while
(listEnumerator.moveNext())
{
var item =
listEnumerator.get_current();
strDropDown+="<Option
value='"+item.get_item('ID')+"'>";
strDropDown+=item.get_item('Title');
strDropDown+="</Option>";
}
strDropDown+="</Select>";
if(document.getElementById("tdItemID"))
{
document.getElementById("tdItemID").innerHTML=strDropDown;
}
}
function Bindfailed(sender, args)
{
alert('failed. Message:' + args.get_message());
}
Search and Update using Client Object Model
Note:-
Use Edit() Function in Search Button Onclick event and Update() Function in Update Button Onclick Event.
Use Edit() Function in Search Button Onclick event and Update() Function in Update Button Onclick Event.
var strItemID="";
var myColl="";
function Edit()
{
ExecuteOrDelayUntilScriptLoaded(SearchRecord, "sp.js");
}
function Update()
{
ExecuteOrDelayUntilScriptLoaded(UpdateRecord, "sp.js");
}
function Edit()
{
ExecuteOrDelayUntilScriptLoaded(SearchRecord, "sp.js");
}
function Update()
{
ExecuteOrDelayUntilScriptLoaded(UpdateRecord, "sp.js");
}
function SearchRecord()
{
try
{
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list =
web.get_lists().getByTitle('Login');
var sQuery = '<View Scope=\'RecursiveAll\'>'+
'<Query>'+
'<Where>'+
'<Eq>'+
'<FieldRef
Name=\'Title\'/>' +
'<Value
Type=\'Text\'>' + document.getElementById("txtUserName").value
+'</Value>'+
'</Eq>'+
'</Where>'+
'</Query>'+
'</View>';
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(sQuery);
this.myColl = list.getItems(camlQuery);
context.load(this.myColl,
'Include(Title, Password, ID)');
context.executeQueryAsync(Function.createDelegate(this,
this.SearchSuccess), Function.createDelegate(this, this.failed));
}
catch(ex)
{
alert(ex.message);
}
}
function SearchSuccess()
{
document.getElementById("divItemID").innerHTML="";
var
listEnumerator = this.myColl.getEnumerator();
while
(listEnumerator.moveNext())
{
var item =
listEnumerator.get_current();
document.getElementById("txtPassWord").value
= item.get_item('Password');
document.getElementById("divItemID").innerHTML=item.get_item('ID');
break;
}
}
function failed(sender, args)
{
alert('failed. Message:' +
args.get_message());
}
function UpdateRecord()
{
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list =
web.get_lists().getByTitle('Login');
var LoginRecord =
list.getItemById(strItemID);
LoginRecord.set_item('Password', document.getElementById("txtPassWord").value);
LoginRecord.update();
context.executeQueryAsync(Function.createDelegate(this,
this.Updatesuccess), Function.createDelegate(this, this.Updatefailed));
}
function Updatesuccess()
{
alert("Record Updated Successfully");
document.getElementById("txtUserName").value="";
document.getElementById("txtPassWord").value="";
}
function Updatefailed()
{
alert('Update Failed');
}
Subscribe to:
Posts (Atom)

