What is jQuery? jQuery is a lightweight JavaScript library that simplifies programming with JavaScript. According to jQuery.com, jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traveral and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. Benefits of jQuery over JavaScript: 1. jQuery is cross-browser 2. jQuery is a lot more easy to use than raw javascript 3. jQuery is extensible 4. jQuery simplifies and has rich AJAX support 5. jQuery has large development community and many plugins. Example autocomplete textbox plugin. 6. Excellent documentation Different between jQuery 1.x and 2.x: jQuery 1.x supports all IE browser versions including IE 6/7/8 and latest. jQuery 2.x supports IE browser versions except IE 6/7/8. jQuery 2.x is small in size than jQuery 1.x as the backward compatibility code is removed from jQuery 2.x version. jQuery Compressed vs Uncompressed versions: Compressed version of jQuery does not contain formating. Removed all white spaces to reduce the size of the file. This is for production environment. Uncompressed verion of jQuery is in readable format. This is used in dev/test/QA environments. Sample: Adding a click event handler for a button control <script type="text/javascript">
$('document').ready(function()
{
$('#button1').click(function ()
{
alert('jQuery Tutorial');
}
});
</script> <input type="button" value="Click Me" id="button1" /> jQuery start points: Method1: $('document').ready(function() ); Method2: $().ready(function() ); - Not recommended Method3: $(function() ); $(document).ready: It is a jQuery event. It fires as soon as the DOM is loaded and ready to be manipulated by script. This is the easiest point in the page load process where the script can safely access elements in the page's HTML DOM. This event is fired before all the images, CSS etc.. are fully loaded. $(window).load: This event fires when the DOM and all the content on the page (images, CSS etc) is fully loaded. Since the window load event waits for images, css etc to be fully loaded, this event fires after ready event. Example: <html>
<head>
<title></title>
<sript scr="scripts/jQuery-1.11.2.js"></script>
<script type="text/javascript">
$(window).load(function () {
alert('Window loaded');
});
$(document).load(function () {
alert('DOM loaded and ready');
});
</script>
</head>
<body>
</body>
</html> In the above example, the first output is "DOM loaded and ready" and then second output is "Window loaded". What is a CDN? CDN stands for Content Delivery Network. A CDN is a system of distributed servers that hosts resources such as images, CSS, JavaScript etc. Companies like Microsoft, Google, Yahoo etc have a free public CDN from which we can load jQuery instead of hosting it on our own web server. Microsoft jQuery CDN: http://www.asp.net/ajax/cdn#jQuery_Releases_on_the_CDN_O Google jQuery CDN: http://developers.google.com/speed/libraries/devguide#jquery Benefits of using CDN: Distributed CDN Servers: The jQuery file can be downloaded from the CDN server that is closest to the user. Browser Caching: jQuery is used on many popular websites. If a user has already visited a webpage that uses jQuery from a CDN, and then if he arrives
at your page, the jQuery file has already been cached by the browser so there is no need to download it again. Parallel Downloads: There is a browser limit on how many files can be concurrently downloaded from a given domain. This number varies from browser
to browser. For example, if the browser allows only 2 concurrent downloads from a given domain, the 3rd download is blocked until one of the previous
files has been fully downloaded. Since the jQuery file is on a CDN, it is being downloaded from a different domain. So this means, the browser
allows another 2 parallel downloads from the CDN server. Reduced server load: The HTTP request for jQuery file is handled by the CDN server, so the load on your web server is reduced. This also means there
is a saving on your website bandwidth consumption which in turn will reduce your hosting cost. Disadvantages: Your client firewalls may block the CDN. So you may have to request your clients to whitelist the CDN. What if the required jQuery file cannot be downloaded from CDN: Let's assume that, the CDN is down or because of some network issue. Then, we won't be able to download jQuery from CDN. In this case we will have
to fall-back to use jQuery file that we hosted on our own server. If jQuery is successfully downloaded, jQuery property is added to the window object. If this property is not found then jQuery is not downloaded. <script scr="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.3.min.js">
</script>
<script>
window.jQuery || document.write("<script src='Scripts/jquery-2.1.3.js'><\/script>");
</script> jQuery Element selector: To select the elements by tag name use jQuery element selector: Syntax: $(element) $('td') // select all td elements $('div a ') // select all anchor elements that are descendants of div element $('div, span, a') // select all div, span and anchor elements Selects all the tr elements on the page and changes their background colour to red $('tr').css('background-Color', 'red'); Alerts the HTML content of the table alert($('table').html()); Alerts the HTML content of each table row $('table tr').each(function () { alert($(this).html()); }); Select and changes the background colour of all the div, span and anchor elements $('div, span, a').css('background-Color', 'yellow'); Select all anchor elements that are descendants of div element $('div a').css('background-Color', 'yellow'); Changes the background color of even rows to gray and odd rows to yellow on both the tables. $('tr:even').css('background-Color', 'gray'); $('tr:odd').css('background-Color', 'yellow'); To change the background color of even rows to gray and odd rows to yellow just for one of the table, use #id selector along with element selector. $('#table1 tr:even').css('background-Color', 'gray'); $('#table1 tr:odd').css('background-Color', 'yellow'); jQuery Class selector: Syntax : $('.class') jQuery class selectors uses JavaScript's native getElementsByClassName() function if the browser supports it. $('.small') // Selects all elements with class small $('.small,.big') // Selects all elements with class small or big $('div.small,.big') // Selects div elements with class small and any element with class big Selects all elements with class "small" and sets 5px solid red border $('.small').css('border', '5px solid red'); Selects all elements with class "small" or "big" and sets 5px solid red border $('.small, .big').css('border', '5px solid red'); Selects all elements with class "small" and all span elements with class "big" and sets 5px solid red border $('.small, span.big').css('border', '5px solid red'); Selects all elements with class small that are nested in a an element with id=div2 and sets 5px solid red border $('#div2 .small').css('border', '5px solid red'); Selects all elements with class small and sets 5px solid red border. Notice div1 has 2 classes - small and big. $('.small').css('border', '5px solid red'); Selects all elements that has both the classes - small and big. There should be no space between the class names. $('.small.big').css('border', '5px solid red'); If you have a space between the two class names then we are trying to find descendants, i.e. find elements with class big that are descendants
of an element with class small. $('.small .big').css('border', '5px solid red'); Another way to selects all elements that has both the classes - small and big is by using filter method. But this approach is
slower because it will first create a list of objects with class "small" and then removes elements that does not have class "big" $('.small').filter('.big').css('border', '5px solid red'); jQuery attribute and attribute value selector: Syntax : $('[attribute]') $('[attribute="value"]') $('[title]') // Selects all elements that have title attribute $('div[title]') // Selects all div elements that have title attribute $('[title="divTitle"]') // Selects all elements that have title attribute value - divTitle $('div[title="divTitle"]') // Selects all div elements that have title attribute value - divTitle Selects all elements with title attribute and sets 5px solid red border $('[title]').css('border', '5px solid red'); Selects all div elements with title attribute and sets 5px solid red border $('div[title]').css('border', '5px solid red'); Selects all elements with title attribute value - div1Title, and sets 5px solid red border $('[title="div1Title"]').css('border', '5px solid red'); Selects all div elements with title attribute value - div1Title, and sets 5px solid red border $('div[title="div1Title"]').css('border', '5px solid red'); Selects all div elements with both title and style attributes, and sets 5px solid black border $('div[title][style]').css('border', '5px solid black'); Selects all div elements with title attribute value - divTitle, and style attribute value - background-color:red, and sets 5px solid black border $('div[title="divTitle"][style="background-color:red"]').css('border', '5px solid black'); Selects all div elements with either title or style attributes, and sets 5px solid black border $('div[title],[style]').css('border', '5px solid black'); jQuery Attribute value operators Attribute Equals Selector [name="value"] Attribute Not Equal Selector [name!="value"] Attribute Contains Selector [name*="value"] Attribute Contains Word Selector [name~="value"] Attribute Contains Prefix Selector [name|="value"] Attribute Starts With Selector [name^="value"] Attribute Ends With Selector [name$="value"] Selects all elements that have title attribute value equal to div1Title $('[title="div1Title"]') Selects all elements that have title attribute value not equal to div1Title $('[title!="div1Title"]') Selects all elements that have title attribute value containing the given substring - Title $('[title*="Title"]') Selects all elements that have title attribute value containing the given word - mySpan, delimited by spaces $('[title~="mySpan"]') Selects all elements that have title attribute value equal to myTitle or starting with myTitle followed by a hyphen (-) $('[title|="myTitle"]') Selects all elements that have title attribute value starting with div $('[title^="div"]') Selects all elements that have title attribute value ending with Heading $('[title$="Heading"]') THIS IS $('div[title!="div1Title"]').css('border', '5px solid red'); EQUIVALENT TO $('div:not([title="div1Title"])').css('border', '5px solid red');
Friday, May 13, 2016
jQuery : Fundamentals
Wednesday, May 11, 2016
REST API Call : Populate drop down control from values in List
Requirement:
Place a drop down control named Language on a page and load list of languages from a SharePoint list.
Solution:
In SharePoint site, create a page. Insert Content Editor web part and place a div tag as below:
<div id="LanguageDrp"></div>
Place following script in a .js file and load the JS file from the page.
-------------------------------------------
var currLang = "";
function getLanguageList()
{
$("div#LanguageDrp").html("" );
$.ajax({
type: "GET",
async:"true",
contentType: "application/json;odata=verbose",
headers: { "Accept": "application/json; odata=verbose" },
url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('Language%20Filter')/items?$select=Title&$orderby=Order0",
success: function(data){
var htmlLang = "";
htmlLang += "<table cellpadding='5' cellspacing='5' style='width:60%'>";
htmlLang += "<tr><td style='color:black;font-weight:bold'>Language</td><td><select id='selLang'>";
$.each(data.d.results, function(index, item){
if(currLang == item.Title)
{
htmlLang +="<option selected value='"+item.Title+"'>"+item.Title+"</option>";
}
else
{
htmlLang +="<option value='"+item.Title+"'>"+item.Title+"</option>";
}
});
htmlLang += "</select></td></tr>";
htmlLang += "</table>";
$("div#LanguageDrp").html(htmlLang );
$("div#LanguageDrp").closest('td').show();//css("display","block");
$("div#LanguageDrp").closest('td').parent().css("width","100%");
$("div#LanguageDrp").parent().parent().css("background","transparent");
$('#selLang').change(function() {
var url = window.location.href;
if (url.indexOf("?")>-1)
{
url = url.substr(0,url.indexOf("?"));
}
if(getParameterByName("Roles")!=null)
{
window.location.replace(url + "?Roles="+ getParameterByName("Roles")+ "&lang=" +$(this).val() );
}
else if(getParameterByName("Related%20Topic")!=null)
{
window.location.replace(url + "?Related%20Topic="+ getParameterByName("Related%20Topic")+ "&lang=" +$(this).val() );
}
else if(getParameterByName("Region")!=null)
{
window.location.replace(url + "?Region="+ getParameterByName("Region")+ "&lang=" +$(this).val() );
}
else
{
window.location.replace(url + "?lang=" +$(this).val() );
}
});
},
error: function(data){
$("div#LanguageDrp").html("<span style='color:red'><b>Unable to get Language Filter - Refresh the page to try again or contact Administrator </b></span>");
} });
}
$(document).ready(function()
{
$("div#LanguageDrp").html("");
if(getParameterByName("lang") == null)
{
currLang = "English";
}
else
{
currLang = getParameterByName("lang");
}
getLanguageList();
});
function getParameterByName( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^]*)",
regex = new RegExp( regexS ),
results = regex.exec( window.location.href );
if( results == null ){
return null;
} else{
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
}
Wednesday, July 9, 2014
SharePoint 2013 Training Material
Basics of SharePoint 2013:
SharePoint Overview
SharePoint Tutorial
Video: SharePoint 2013 Overview (57 min)
SharePoint 2013 training for IT pros
Note: Will keep adding more links to this page for future reference and readings.
SharePoint Overview
SharePoint Tutorial
Video: SharePoint 2013 Overview (57 min)
SharePoint 2013 training for IT pros
Note: Will keep adding more links to this page for future reference and readings.
Monday, June 30, 2014
Recovering Workflow History after 60 Days
I really like this article and helped out resolving the issue:
Reference Site: Recovering Workflow History After 60 Days
Reference Site: Recovering Workflow History After 60 Days
Workflow
history is one of two things to SharePoint users. I suspect for the
majority, they aren't even aware of it, and don't have any need for it.
For a small minority, they are fully aware of it for one important
reason – compliance. Workflows are nearly always used as part of a
larger business process, and often these business processes require
auditing to ensure compliance with whatever industry standard the
business operates with. When SharePoint workflows are used, workflow
history is usually seized upon by users as being an easy way to audit
compliance. After all, it's easy to get at isn't it?
Certainly while the workflow is in progress, and for a couple of months afterwards it is. But what happens when the end of year audit arrives, and the auditor goes to look at the history for a workflow completed 11 months ago? Disaster – it's not there! There must have been many a frantic phone call between panicking compliance officers and frustrated IT staff along the lines of this:
Out of the box, the workflow history contains a lot of GUIDs instead
of real names (I suppose this is where deleting all those links made
sense to Microsoft). To make it more human legible, you can add further
calculated columns to the workflow history list to turn some of those
column values back into real names. A good example is the workflow name,
which is represented by "workflow association ID"
Certainly while the workflow is in progress, and for a couple of months afterwards it is. But what happens when the end of year audit arrives, and the auditor goes to look at the history for a workflow completed 11 months ago? Disaster – it's not there! There must have been many a frantic phone call between panicking compliance officers and frustrated IT staff along the lines of this:
- [Compliance officer] "My workflow history has been deleted! The auditor is going to fail us! Where has it gone?"
- [IT support] (probably after Googling "Workflow history deleted") "This is by design. SharePoint deletes workflow history after 60 days"
- [Compliance officer] "WHAT?! Nobody told me that! Can you recover it?"
- [IT support] "We can, we'll just need turn off the timer job and then restore the entire SharePoint farm for each month in question."
- [Compliance officer] "How long will that take?"
- [IT support] "Hmmm…."
So Where Is Workflow History after 60 days?
Put simply, it's in the same place as it's always been. There's a hidden list in every SharePoint site with the workflow feature activated called "workflow history" and it's under lists, so pointing your browser at http://[sitename]/[subweb]/lists/workflow%20history/ will show you this list. It's not pretty, and certainly not usable by an end user in its default view, but it is the same content that was available from the item that the original workflow ran on. All that happens after a workflow has been closed for 60 days is that the relationship links between the item (list item or document) and the workflow history are removed from the database by a timer job. The reason this is done is that a workflow can consist of many individual steps, each of which gets recorded in the history list. Maintaining those links in the database for every workflow that ever runs in a site slows performance down. So Microsoft implemented a clean-up job to remove the links, making it appear from the item that the workflow history is gone. It's possible to disable the timer job, but this has to be done at the application level, will kill performance in the long term, and doesn't help you get back the "missing" workflow history.Making Workflow History Usable Again
Knowing that all Workflow History is available in a list, all we need to do is link it back to the original item using a calculated column and a view. The basic steps are:- Create a view of the workflow history list that uses the filtered ID to present the history of a particular workflow in a recognisable format.
- Create a new calculated column in the list or library that is associated with the workflow.
- Write a formula in the calculated column that inserts the item/document ID into a link that can be passed to a view of the workflow history list.
Create views of the Workflow History List
- Open the workflow history list at http://appname/subweb/workflow%20history/
- Create a new shared view; you'll need one for each list that has a workflow associated with it – if there's only one, call the new view "audit view", otherwise "workflow name – audit view" or something similar.
- You'll need to identify the List or Library ID (GUID) – You can use the full history list for this.
- As a minimum, add the following columns to the view:Date Occurred
User ID
Event Type
Outcome
Description - Sort the view by "Date Occurred"
- Filter the view by "List ID" (List ID is equal to GUID – include the braces)
- Group by "Primary Item ID", then by "Workflow History Parent Instance"
- Save the view, try it out – add any other customisations your audit process may need.
Create the calculated column for a list/library
- Within the list that is associated with the workflow, add a new calculated column. Do this for each list from which you need to see the workflow history.
- Enter the following formula, replacing appname and subweb with the address of your site, and viewname with the view you just created:=CONCATENATE("http://appname/subweb/Lists/Workflow%20History/viewname.aspx?&FilterField1=Item&FilterValue1=",ID)
- Add this column to the default view, or create an "auditor's view" of the list, containing this column and any other pertinent information.
- Now users can click on the link created dynamically by this column to return a filtered view of the workflow history, containing audit information on each step in every workflow that ran for this list item.
Make the workflow history easier to read
Out of the box, the workflow history contains a lot of GUIDs instead
of real names (I suppose this is where deleting all those links made
sense to Microsoft). To make it more human legible, you can add further
calculated columns to the workflow history list to turn some of those
column values back into real names. A good example is the workflow name,
which is represented by "workflow association ID" - Add a new calculated column called "Workflow name" to the workflow history list.
- Use the following formula:=IF([Workflow Association ID]="{GUID of particular workflow}", "Name of particular workflow",IF([Workflow Association ID]="{GUID of another particular workflow}", "Name of another particular workflow"))
- Now save and add this column to your workflow audit views.
Friday, May 17, 2013
SharePoint Reporting : PerformancePoint Services Dashboard using Analysis Services
Part - 1
Part - 2
Part - 3
Microsoft Analysis Services - Basic Presentations (Cube,Dimensions,Measures,Facts and So on)
Analysis Services - 01 Prerequisite Guide
Analysis Services - 02 Data Source Creation
Analysis Services - 03 Data Source Views
Analysis Services - 04 Cube Creation
Analysis Services - 05 Dimension Fundamentals
Analysis Services - 06 Dimension Hierarchies
Analysis Services - 07 Dimension Attribute Relationships
Analysis Services - 08 Dimension Storage
Analysis Services - 09 Dimension Discretization
Analysis Services - 10 Parent/Child Dimension Hierachies
Analysis Services - 11 Star and Snowflake Schemas
Analysis Services - 02 Data Source Creation
Analysis Services - 03 Data Source Views
Analysis Services - 04 Cube Creation
Analysis Services - 05 Dimension Fundamentals
Analysis Services - 06 Dimension Hierarchies
Analysis Services - 07 Dimension Attribute Relationships
Analysis Services - 08 Dimension Storage
Analysis Services - 09 Dimension Discretization
Analysis Services - 10 Parent/Child Dimension Hierachies
Analysis Services - 11 Star and Snowflake Schemas
Labels:
Cubes,
Dimensions,
Facts,
Measures,
SSAS
Wednesday, May 8, 2013
Project Server 2010 : Failed to provision site PWA with error: System.NullReferenceException: Object reference not set to an instance of an object.
Problem:
I was trying to take project server 2010 databases from PROD and refresh them in the DEV environment by using 5 database restore process (Reference: Project Server 2010 : Migration or Restore in New Farm) .
When I tried initially, the PWA site was missing the Project Site urls under Server Settings -> Project Sites page. Then, I deleted the SharePoint web application and also deleted the Project Server related 5 DBs manually. I restored the 5 DBs and added the project server content db to the newly created web application. When I tried to Provision the Project Web Application (PWA), it failed and I observed the following 3 error messages in Event Log:
Event Log: Error Log Entry 1
Failed to provision site PWA with error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)
Failed to provision site PWA with error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)
Event Log Error Entry 2: Provisioning ‘PWA’: Project site object creation failed. Exception ‘System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)’.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)’.
Event Log Error Entry 3: ProjectSite not created.
SOLUTION:
Something in the SharePoint config or Project Server Config was corrupted.
After hours of trial, I ran the Project Server Installation wizard and did Repair of the installation. The repair process went successfully.
After that, I did following:
a. Created Web Application with default root site collection.
b. Ensure that site is up and working fine.
c. Go to manage content databases, remove the content database for the above created web application.
d. Restored all the 5 databases in the database server.
e. Attached the project server content database(s) to the web application using the STSADM command (not thru UI). After attaching, if we go to View Site Collections option from Central Admin, we should be able to see PWA site collection for the above created web application.
f. Navigated to Project Server Service Application and created a new Project Web Application by pointing to restored Archive, Published, Reporting, Draft databases.
g. Project Web Application provisioning took sometime and provisioned successfully.
h. When I opened the PWA site, the site came up fine but faced few minor issues which I resolved with the help of following posts:
a. Created Web Application with default root site collection.
b. Ensure that site is up and working fine.
c. Go to manage content databases, remove the content database for the above created web application.
d. Restored all the 5 databases in the database server.
e. Attached the project server content database(s) to the web application using the STSADM command (not thru UI). After attaching, if we go to View Site Collections option from Central Admin, we should be able to see PWA site collection for the above created web application.
f. Navigated to Project Server Service Application and created a new Project Web Application by pointing to restored Archive, Published, Reporting, Draft databases.
g. Project Web Application provisioning took sometime and provisioned successfully.
h. When I opened the PWA site, the site came up fine but faced few minor issues which I resolved with the help of following posts:
Finally happy with the output 
Note: The above is just my experience. Please ensure you fully understand and leverage from my experience for your needs to avoid any further issues.
Wednesday, May 1, 2013
Project Server 2010 : PWA Errors and Trouble-shooting
While I was refreshing DEV environment from PROD for Project Server, I ran into many issues.
The following article explained the solution for various of the issues:
MS Project Server 2010 -> PWA Errors & Troubleshooting
The following article explained the solution for various of the issues:
MS Project Server 2010 -> PWA Errors & Troubleshooting
Labels:
project server,
project server 2010,
pwa
Tuesday, April 30, 2013
Project Server 2010 : Common errors when a PWA site is deleted ‘incorrectly’
From last few days, I was working multiple Project Server 2010 installations/migrations.
I ran into many issues and I came across the following blog post which helped me in resolving those issues.
Common errors when a PWA site is deleted ‘incorrectly’
I ran into many issues and I came across the following blog post which helped me in resolving those issues.
Common errors when a PWA site is deleted ‘incorrectly’
Labels:
project,
project server,
project server 2010,
ps2010
Project Server 2010 : Migration or Restore in New Farm
Currently, I am working on Project Server 2010 restoring the PROD copy in DEV/TST environment.
As we know, there are 5 databases related to Project Server 2010 which we need to use for migration/restoring in new farm.
There are many approaches for this operation which are explained well in the following blog posts from Andrew:
Project Server 2010 Database Restore (Part I)
Project Server 2010 Database Restore (Part II)
As we know, there are 5 databases related to Project Server 2010 which we need to use for migration/restoring in new farm.
There are many approaches for this operation which are explained well in the following blog posts from Andrew:
Project Server 2010 Database Restore (Part I)
Project Server 2010 Database Restore (Part II)
Labels:
project,
project server,
project server 2010,
ps2010
Wednesday, April 24, 2013
PowerShell - "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered." or Microsoft SharePoint is not supported with version 4.0.30319.17929 of the Microsoft .Net Runtime
I ran into the following issues, when I open PowerShell management console for SharePoint:
a. The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered
b. Microsoft SharePoint is not supported with version 4.0.30319.17929 of the Microsoft .Net Runtime
The solution is mentioned in microsoft support post. Click Here to see the post.
Solution:
To work around this issue, change the Target field value for SharePoint 2010 Management Shell. To do this, follow these steps:
a. The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered
b. Microsoft SharePoint is not supported with version 4.0.30319.17929 of the Microsoft .Net Runtime
The solution is mentioned in microsoft support post. Click Here to see the post.
Solution:
To work around this issue, change the Target field value for SharePoint 2010 Management Shell. To do this, follow these steps:
- Click Start, and then right-click SharePoint 2010 Management Shell.
- Click Properties.
- Click the Shortcut tab in the SharePoint 2010 Management Shell Properties window.
- Input the following value in the Target field:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Version 2.0 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
Issues Uploading Large Files To SharePoint
At a client, I came across with an issue with uploading large files to SharePoint.
We have SharePoint servers in US and the user is located in Asian countries. When the user tries to upload large file, the SharePoint site's request is getting time-out message.
I am still trying to know more details but found a blog post which contains various methods/approaches to fix the issue.
Very nicely documented post (we may know some of them but good to see everything related are placed together) : Issues Uploading Large Files To SharePoint
We have SharePoint servers in US and the user is located in Asian countries. When the user tries to upload large file, the SharePoint site's request is getting time-out message.
I am still trying to know more details but found a blog post which contains various methods/approaches to fix the issue.
Very nicely documented post (we may know some of them but good to see everything related are placed together) : Issues Uploading Large Files To SharePoint
Tuesday, April 23, 2013
SharePoint Config database Log file too big – reduce it!
Today, I wanted to refresh a content database in test environment from production environment.
In test environment, I see the d drive is almost full. Out of 200 GB, only 8 GB was left out.
There were 10 web applications and many service applications were configured in test environment.
I checked the SQL Server and found that transaction log file sizes became huge.
For SharePoint config database log, I see the transaction log file size as 36 GB.
Due to lack of space, I was not able to restore my content db from prod.
I started focusing on shrinking the transaction log files.
We need to ensure that transaction log file backup are taken before we start shrinking. As it is test environment, we don't need to worry about backup as it contains test data.
I was able to shrink all transaction log files for all the config databases and able to get around 60 GB free space.
Note: We can perform shrinking on databases or individual database files (.mdf & .ldf).
Reference article about how to shrink database or files
In test environment, I see the d drive is almost full. Out of 200 GB, only 8 GB was left out.
There were 10 web applications and many service applications were configured in test environment.
I checked the SQL Server and found that transaction log file sizes became huge.
For SharePoint config database log, I see the transaction log file size as 36 GB.
Due to lack of space, I was not able to restore my content db from prod.
I started focusing on shrinking the transaction log files.
We need to ensure that transaction log file backup are taken before we start shrinking. As it is test environment, we don't need to worry about backup as it contains test data.
I was able to shrink all transaction log files for all the config databases and able to get around 60 GB free space.
Note: We can perform shrinking on databases or individual database files (.mdf & .ldf).
Reference article about how to shrink database or files
Friday, April 19, 2013
SharePoint 2010 - Workflow Articles
I have been using workflows in SharePoint from last 5 years in SP 2007/2010.
I have developed custom visual studio workflows (sequential) and also used out of the box workflows & designer workflows.
Here are good collection of workflow articles, I prefer to read:
Article 1: Understand approval workflows in SharePoint 2010
Article 2: Step by Step : Creating Workflows for SharePoint 2010
Step 1 Step 2 Step 3 Step 4
Article 3: Walkthrough: Create SharePoint 2010 Workflow Association Form and Initiation Form in Visual Studio 2010 by using Application Pages - Part 1 Part 2 Note: I will keep on adding articles to the above list as and when I find interesting article.
I have developed custom visual studio workflows (sequential) and also used out of the box workflows & designer workflows.
Here are good collection of workflow articles, I prefer to read:
Article 1: Understand approval workflows in SharePoint 2010
Article 2: Step by Step : Creating Workflows for SharePoint 2010
Step 1 Step 2 Step 3 Step 4
Article 3: Walkthrough: Create SharePoint 2010 Workflow Association Form and Initiation Form in Visual Studio 2010 by using Application Pages - Part 1 Part 2 Note: I will keep on adding articles to the above list as and when I find interesting article.
Thursday, April 18, 2013
A Complete Guide to Writing Timer Jobs in SharePoint 2010
I wrote SharePoint time jobs many times in SP 2007 and SP 2010.
I read various articles on writing timer jobs.
The following article contains everything about writing timer jobs.
I read various articles on writing timer jobs.
The following article contains everything about writing timer jobs.
A Complete Guide to Writing Timer Jobs in SharePoint 2010
I recommend this article to new or experience timer job developers.
SharePoint 2010 Kerberos Configuration Guidence
For few clients, recently I configured Kerberos.
Kerberos always treated as hard component to configure due to various reasons such as trouble-shooting the issues, understanding the configuration for various services.
Guidence for Kerberos Configuration taken from the following document:
http://www.microsoft.com/en-us/download/details.aspx?id=23176
Kerberos always treated as hard component to configure due to various reasons such as trouble-shooting the issues, understanding the configuration for various services.
Guidence for Kerberos Configuration taken from the following document:
Configuring Kerberos Authentication for Microsoft SharePoint 2010 Products
http://www.microsoft.com/en-us/download/details.aspx?id=23176
Delegation tab in Active Directory User Console not available until a SPN is set
Recently, I configured Kerberos for SharePoint 2010.
As part of the configuration, I was trying to set values under delegation table for the user account.
I don't find the delegation tab for the user/service account.
Solution: We have to set SPN for the user account. Then only, we will see delegation tab for the user account in Active Directory for Users.
Here are few blog posts referring to:
http://blogs.msdn.com/b/mattlind/archive/2010/01/14/delegation-tab-in-aduc-not-available-until-a-spn-is-set.aspx
http://social.technet.microsoft.com/Forums/en-US/winserverDS/thread/589e153f-f8a0-4aa2-a371-8e77ffa216dd/
As part of the configuration, I was trying to set values under delegation table for the user account.
I don't find the delegation tab for the user/service account.
Solution: We have to set SPN for the user account. Then only, we will see delegation tab for the user account in Active Directory for Users.
Here are few blog posts referring to:
http://blogs.msdn.com/b/mattlind/archive/2010/01/14/delegation-tab-in-aduc-not-available-until-a-spn-is-set.aspx
http://social.technet.microsoft.com/Forums/en-US/winserverDS/thread/589e153f-f8a0-4aa2-a371-8e77ffa216dd/
Tuesday, July 10, 2012
SharePoint 2010 : Master Pages Basics
In SharePoint 2010, the site pages and application pages could link to the same master page. This is a nice enhancement in SP 2010 whereas in SP 2007 had limitations that made it difficult to support linking site pages and application pages to the same master page.
SharePoint Foundation provisions the following three master page instances:
a. v4.master
b. minimal.master
c. default.master
v4.master: This is the primary master page used as the standard master page in SharePoint 2010 sites. This common layout (also known as Chrome) contains elements such as Site Actions menu, the breadcrumb trail, the Ribbon, the Welcome menu, the Site Icon, the TopNav bar, and the Quick Launch. This master page provides the default layout for SharePoint 2010 sites.
minimal.master: This provides a page layout without any of the chrome that is included in v4.master. The minimal.mnaster page is used by several of the standard site page templates and application pages that are distributed along with SharePoint Foundation and SharePoint Server 2010.
default.master: This master page designed to support a feature known as Visual Upgrade, which assists companies that are upgrading SharePoint 2007 sites to run within SharePoint 2010 farms.
Visual Upgrade process:
Default.master contains the standard HTML layout and chrome of a SharePoint 2007 site. When a site is upgraded from SharePoint 2007 to SharePoint 2010, SharePoint Foundation has its pages initially link to default.master instead of v4.master. The idea is that companies can upgrade from SharePoint 2007 to SharePoint 2010 without forcing their users to switch to the new SharePoint 2010 user interface immediately.
Important Note:
a. default.master is involved only when upgrading SharePoint 2007 sites to SharePoint 2010. If we are not involved in upgrade scenarios, yours sites will never use default.master.
b. The master pages in the Master Page Gallery is that they are created initially in a ghosted state ie., every SharePoint 2010 site gets a copy of v4.master that is processed using a master page template that exists on the file system of the front-end Web server.
A customized master page runs in Safe Mode, which means that it cannot contain inline code.
SharePoint Foundation provisions the following three master page instances:
a. v4.master
b. minimal.master
c. default.master
v4.master: This is the primary master page used as the standard master page in SharePoint 2010 sites. This common layout (also known as Chrome) contains elements such as Site Actions menu, the breadcrumb trail, the Ribbon, the Welcome menu, the Site Icon, the TopNav bar, and the Quick Launch. This master page provides the default layout for SharePoint 2010 sites.
minimal.master: This provides a page layout without any of the chrome that is included in v4.master. The minimal.mnaster page is used by several of the standard site page templates and application pages that are distributed along with SharePoint Foundation and SharePoint Server 2010.
default.master: This master page designed to support a feature known as Visual Upgrade, which assists companies that are upgrading SharePoint 2007 sites to run within SharePoint 2010 farms.
Visual Upgrade process:
Default.master contains the standard HTML layout and chrome of a SharePoint 2007 site. When a site is upgraded from SharePoint 2007 to SharePoint 2010, SharePoint Foundation has its pages initially link to default.master instead of v4.master. The idea is that companies can upgrade from SharePoint 2007 to SharePoint 2010 without forcing their users to switch to the new SharePoint 2010 user interface immediately.
Important Note:
a. default.master is involved only when upgrading SharePoint 2007 sites to SharePoint 2010. If we are not involved in upgrade scenarios, yours sites will never use default.master.
b. The master pages in the Master Page Gallery is that they are created initially in a ghosted state ie., every SharePoint 2010 site gets a copy of v4.master that is processed using a master page template that exists on the file system of the front-end Web server.
A customized master page runs in Safe Mode, which means that it cannot contain inline code.
Tuesday, October 18, 2011
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
Today, I come across with a situation. I am writing a WCF service which uses LINQ to talk to database tables for DML operations.
One of the table column is of DateTime format. I mapped this with System.DateTime in Csharp. When I ran the WCF service and tried to perform insert operation, it throws following error:
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
I found a fix at http://geekswithblogs.net/AzamSharp/archive/2008/01/10/118446.aspx
It worked great.
One of the table column is of DateTime format. I mapped this with System.DateTime in Csharp. When I ran the WCF service and tried to perform insert operation, it throws following error:
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
I found a fix at http://geekswithblogs.net/AzamSharp/archive/2008/01/10/118446.aspx
It worked great.
Friday, April 16, 2010
Default Web Part
When we create any list or document library, it gets created with few default aspx pages like AllItems.aspx, NewForm.aspx, EditForm.aspx and DispForm.aspx.
I generally preferred to customize these forms or by creating new views.
When we do it, the default web part in these pages is the biggest blocker to perform our work.
If we delete the default web part, god knows or Microsoft knows about the problems you will run into. So, NEVER EVER delete default web part from above pages. Better keep this web part hidden and closed. You can do it in the designer by right-clicking on the web part and go to web part properties. For NewForm.aspx and other aspx pages, we will see Edit Page link under Site Settings is disabled. Also, you are not allowed to user designer to remove/close/hide the web part when the application is in DEV/TEST/Production servers.
So, what is the alternative?
For the above pages, append "contents=1" at the end of the url.
Note: If the url has no parameters, then add "?contents=1". If the url has # at the end, then delete the character "#" and then add "&contents=1".
I ran into this issue during my deployment of sharepoint application.
I generally preferred to customize these forms or by creating new views.
When we do it, the default web part in these pages is the biggest blocker to perform our work.
If we delete the default web part, god knows or Microsoft knows about the problems you will run into. So, NEVER EVER delete default web part from above pages. Better keep this web part hidden and closed. You can do it in the designer by right-clicking on the web part and go to web part properties. For NewForm.aspx and other aspx pages, we will see Edit Page link under Site Settings is disabled. Also, you are not allowed to user designer to remove/close/hide the web part when the application is in DEV/TEST/Production servers.
So, what is the alternative?
For the above pages, append "contents=1" at the end of the url.
Note: If the url has no parameters, then add "?contents=1". If the url has # at the end, then delete the character "#" and then add "&contents=1".
I ran into this issue during my deployment of sharepoint application.
Labels:
default web part,
invalid page url,
SharePoint
Subscribe to:
Posts (Atom)