Tuesday, October 14, 2014
Wednesday, October 1, 2014
SharePoint 2013 REST API calls using Fiddler
SharePoint 2013 REST API is the best choice to access server objects from client site. The easiest and more convenient way to test this is using Fiddler tool
The below are the two samples to demonstrate how to use Fiddler and pass header and body content to send request
Example 1: Add a list item (task) to a List (Tasks list)
Header
ACCEPT: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: 0xE2872916105EF8654E29E7295F06D7A0CA96847415B5AC010F00FE871BADC181D85783853ECA1C9002C402B675F2CC00C9312293668F261888E7B3694F138567,01 Oct 2014 18:39:40 -0000
Host: yourhost.com
Content-Length: 91
Body
{'__metadata': {'type':'SP.Data.TasksListItem'},
'Title': 'Let me in via Fiddler REST'
};
Example 2: Add a list to a Web
Header
ACCEPT: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: 0x16F60B1D8E5FD4DEC53E3609823866DA3DD8BC187A2C4F8070B4761183FC2C60B974ECA083B2E5613A1019C79277B18B4EDDEB41E3452F2D43CCD01ACDAF3957,01 Oct 2014 19:41:49 -0000
Host: rmitscvpspqa02:2000
Content-Length: 191
Body
{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test List from fiddler' }

The below are the two samples to demonstrate how to use Fiddler and pass header and body content to send request
Example 1: Add a list item (task) to a List (Tasks list)
Header
ACCEPT: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: 0xE2872916105EF8654E29E7295F06D7A0CA96847415B5AC010F00FE871BADC181D85783853ECA1C9002C402B675F2CC00C9312293668F261888E7B3694F138567,01 Oct 2014 18:39:40 -0000
Host: yourhost.com
Content-Length: 91
Body
{'__metadata': {'type':'SP.Data.TasksListItem'},
'Title': 'Let me in via Fiddler REST'
};
Example 2: Add a list to a Web
Header
ACCEPT: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: 0x16F60B1D8E5FD4DEC53E3609823866DA3DD8BC187A2C4F8070B4761183FC2C60B974ECA083B2E5613A1019C79277B18B4EDDEB41E3452F2D43CCD01ACDAF3957,01 Oct 2014 19:41:49 -0000
Host: rmitscvpspqa02:2000
Content-Length: 191
Body
{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test List from fiddler' }

To test it, go to SharePoint site and verify. Its cool :)
Note : Where do I get the form digest value to include in my request?
As described on this page on MSDN, you can retrieve this value by making a POST request with an empty body to http://site/_api/contextinfo and extracting the value of the “d:FormDigestValue” node in the XML that the contextinfo endpoint returns.
Thursday, September 25, 2014
Solution deployment stuck on deploying
I got the deployment issue in visual studio and powershell scripts in farm solutions. Most of the solutions in the google are suggesting to do the following steps and I did and restarted the all the servers. But the issue continues. Fortunately I got the real reason after reviewing the sharepoint log file. So the lesson learned is "The reason may be anything and review your log file carefully"
The actions which I tried (not got the solution)
1. Make sure SharePoint timer service should be started on all the servers (web front ends as well as app server)
2. Try restarting the SharePoint Administration service on all the servers.
3. Restart all the SharePoint servers
4. Make sure that all the servers in farm are on the same time zone.
5. Execute stsadm -o execadmsvcjobs on all the servers of the farm
6. Cancel the deployment job by means of central administration, remove the solution and try to add the solution again & check the results.
7. Check the status of the jobs by means of CA-timer job status or use te following command - stsadm -o enumdeployments - This will give you the list of all the pending & active deployments.
Still had the error while cancel the deployment job using CA. The error thrown by CS is "Object reference not set to an instance of an object". This confuses me more and I started reviewing the sharepoint log file using ULS Viewer, and I got the real reason for this strange behaviour.
SharePoint Log Critical Error
Database full error on SQL Server instance 'XXX' in database 'SharePoint_Config'. Additional error information from SQL Server is included below. Could not allocate space for object 'dbo.Tombstones'.'PK_Tombstones' in database 'SharePoint_Config' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Solution
Increased the DB size and the issue is resolved
USE master;
GO
ALTER DATABASE SharePoint_Config
MODIFY FILE
(NAME = test1dat3,
SIZE = 10240MB);
GO
or Use "SQL Management Studio" as shown below.
The actions which I tried (not got the solution)
1. Make sure SharePoint timer service should be started on all the servers (web front ends as well as app server)
2. Try restarting the SharePoint Administration service on all the servers.
3. Restart all the SharePoint servers
4. Make sure that all the servers in farm are on the same time zone.
5. Execute stsadm -o execadmsvcjobs on all the servers of the farm
6. Cancel the deployment job by means of central administration, remove the solution and try to add the solution again & check the results.
7. Check the status of the jobs by means of CA-timer job status or use te following command - stsadm -o enumdeployments - This will give you the list of all the pending & active deployments.
Still had the error while cancel the deployment job using CA. The error thrown by CS is "Object reference not set to an instance of an object". This confuses me more and I started reviewing the sharepoint log file using ULS Viewer, and I got the real reason for this strange behaviour.
SharePoint Log Critical Error
Database full error on SQL Server instance 'XXX' in database 'SharePoint_Config'. Additional error information from SQL Server is included below. Could not allocate space for object 'dbo.Tombstones'.'PK_Tombstones' in database 'SharePoint_Config' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Solution
Increased the DB size and the issue is resolved
USE master;
GO
ALTER DATABASE SharePoint_Config
MODIFY FILE
(NAME = test1dat3,
SIZE = 10240MB);
GO
or Use "SQL Management Studio" as shown below.
Sunday, September 21, 2014
Useful Links
http://aaclage.blogspot.ca/2013/09/example-custom-ui-metro-style-tiles.html
http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/
http://www.sharepointanalysthq.com/2014/05/custom-webpart-editor/
http://fahadzia.com/blog/2009/08/peopleeditorpeoplepicker-control-as-web-part-property/
http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/
http://www.sharepointanalysthq.com/2014/05/custom-webpart-editor/
http://fahadzia.com/blog/2009/08/peopleeditorpeoplepicker-control-as-web-part-property/
Thursday, September 18, 2014
SharePoint 2013 Modal Dialog with parent page refresh
<script type="text/javascript">
function ShowModal() {
ExecuteOrDelayUntilScriptLoaded(function () {
var options = {
url: 'http://sharepointsite.com/sites/devsite/Lists/Project%20Tasks/DispForm.aspx?ID=2&Source=http%3A%2F%2Frmitscvpspqa02%3A1000%2Fsites%2Fdevsite%2FLists%2FProject%2520Tasks%2FAllItems%2Easpx&ContentTypeId=0x010800EFF7689E39CAEB4C9BF59AEB73ABEFA9',
tite: 'Add Vendor',
width: 800,
height: 475,
allowMaximize: true,
showClose: true,
dialogReturnValueCallback: scallback
};
SP.UI.ModalDialog.showModalDialog(options);
}, 'sp.js');
}
function scallback(dialogResult, returnValue) {
alert(dialogResult);
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
if (dialogResult == SP.UI.DialogResult.OK) {
alert('Ok');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
}
</script>
<input onclick="javascript:ShowModal();" type="button" value="Model Popup"/>
Friday, September 5, 2014
Office 365 Development Setup & SharePoint PnP
Step 1 : SharePoint Online: Sign up for a free Office 365 Developer Site from your MSDN subscription
Step 3 : The home page will be shown like the below image
4
Step 4 : Click the SharePoint and the SharePoint Administrator page will appear as shown below. Note that the admin website link is required for some visual studio app development.
Step 5 : Create a Developer Site collection and it is highlighted as shown below
Step 6 : Now go to https://github.com/OfficeDev/PnP
and download the sample ZIP file. It contains core components and samples and
need VS 2013 (I tried using VS2013)
Step 7 : Open a sample project from the downloaded zip
file
Step 9 : That is it. :) ... Make sure you understand the code in the samples which will make your work easy and reduce your code dramatically. The good thing is its all CSOM and hosted in S2S (Provider hosted app model).
Reference :
Wednesday, September 3, 2014
SharePoint 2013 Designer Workflow - Expense claims approval process part 2 of 3
List of Article in Series
1.
Overview of Business requirement (part 1/3)
2. Build Workflow using SharePoint
Designer (part 2/3)
3. Deployment and Testing (part 3/3)
Build Workflow using SharePoint
Designer
In my previous article I have explained
the expense claims workflow logic and provided a Visio diagram. Make sure to
read the first article before proceeding further.
Used SharePoint Designer to develop the
workflow and no code. I used some basic activities which are available in
SharePoint 2013 and built a complex ( J ) approval process.
The below are the Text-based and visual
workflow designer code.
Text-based
Visual Designer
Subscribe to:
Posts (Atom)












