Updated Visual Studio 2015 to Update 1 only to find out that my SharePoint add-in won't deploy.
The error message: The active deployment configuration 'Deploy App for SharePoint' cannot be located. Specify a valid deployment configuration in the Project Properties.
The message is fine. It tells you what to do. I guess, changing the property automatically is too much to ask.
The arrow for the property is grayed out in the Property window :-)
The Solution:
1. Right-click on your project in Solution Explorer
2. Select "SharePoint" and change the value to "...Add-in..." in the "Active Depl. Conf." drop-down
Wednesday, March 16, 2016
Thursday, February 4, 2016
Sharepoint Update vs Systemupdate vs UpdateOverwriteVersion
When creating event receivers or workflows it might be interesting to
look at the differences between the following SPListItem methods. The
differences might be subtle but it can make a huge difference when you
have extra event receivers or workflows attached to your SharePoint list
or items.
You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”
Update()
- Updates the item in the database.
- Updates the “Modified” and “Modified by” values.
- Creates a new version
Systemupdate()
- Updates the item in the database.
- No changes in the “Modified” and “Modified By” fields.
- No new version.
- Triggers the item events.
Systemupdate(true)
- Same as Systemupdate() and increments the item version.
- Using SystemUpdate(false) is exactly the same as SystemUpdate()
UpdateOverwriteVersion()
- Updates the item but does not create a new version.
- Updates the “Modified” and “Modified by” values.
You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”
Tuesday, February 2, 2016
Formatting a Date in Your Display Template
Date formatting in SharePoint is a subject discussed over and over in all communities, forums, blogs, etc. Whether it is some discrepency in daylight savings time output, region settings or just simply to render the date in a format that fits your design implementation guidelines.
I'll be discussing the latter - using SharePoint 2013's content by search web part and display templates.
In the following sample, we have an article displayed with 3 very common components - Date, Title and Description. As you can see, the date has a specific format that needs to be followed.

During the process of creating the article the date will be selected by the content author using a date field like so.

SharePoint by default takes the value and formats the date. So in search results it renders like this...
Wednesday, November 5, 2014
To control the output for the date that you want, you will have to add a couple of variables to your display template. The first variable (which I'm calling parseDate) takes the inputValue, that is stored in the database as a text string object, and parses the value of the field back to a datetime object. The second variable does the actual formatting.
In your display template you will see sections of javascript code enclosed in tags like these - you will see where all the initial variables are set...this is where you will be adding the variables.
<!--#_

_#-->
And here's the code for copying.
var parseDate = new Date(line3.inputValue);
var line3Date = parseDate.format('MM/dd/yyyy');
Finally - anywhere you want to render the newly formatted date you will add this snippet.
_#= line3Date =#_
Refer to http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.95).aspx for more information on the specific date formatting rules that you can use.
Thursday, January 21, 2016
Load test your app in the cloud
https://www.visualstudio.com/en-us/get-started/test/load-test-your-app-vs
Monday, January 4, 2016
JSON : JavaScript Object Notation
JSON is a syntax for storing and exchanging data.
JSON is a light weight data-interchange format.
JSON is language independent
A JavaScript program can use standard JavaScript function to convert JSON data into native JavaScript objects, instead of using any parser.
Difference between XML and JSON:
Why JSON:
Using XML - 1. Fetch an XML document 2. Use XML DOM to loop through the document 3. Extract values and store in variables.
Using JSON - 1. Fetch a JSON string 2. JSON. Parse the JSON string
JSON is faster and easier than XML.
JSON Syntax:
The JSON syntax is a subset of the JavaScript syntax. JSON syntax rules:
JSON arrays are written inside square braces. JSON array can contain multiple objects.
Example:
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter","lastName":"Jones"}]
JSON is a light weight data-interchange format.
JSON is language independent
A JavaScript program can use standard JavaScript function to convert JSON data into native JavaScript objects, instead of using any parser.
Difference between XML and JSON:
- JSON doesn't use end tags
- JSON is shorter
- JSON is quicker to read and write
- JSON can use arrays
- XML has to be parsed with the XML Parser, JSON can be parsed by a standard JavaScript function.
Why JSON:
Using XML - 1. Fetch an XML document 2. Use XML DOM to loop through the document 3. Extract values and store in variables.
Using JSON - 1. Fetch a JSON string 2. JSON. Parse the JSON string
JSON is faster and easier than XML.
JSON Syntax:
The JSON syntax is a subset of the JavaScript syntax. JSON syntax rules:
- Data is in name/value pair
A name/value pair consists of a field name(in double quotes), followed by a colon, followed by a value. Example:"firstName":"John"
JSON name requires double quotes. JavaScript names don't.
JSON value can be an a number, a string, a Boolean, an array, an object, null.
- Data is separated by commas
- Curly braces holds objects
JSON objects are written inside curly braces. JSON objects can contain multiple name/values pairs. Example : {"firstName":"John", "lastName":"Doe"}
- Square braces holds arrays.
JSON arrays are written inside square braces. JSON array can contain multiple objects.
Example:
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter","lastName":"Jones"}]
SharePoint 2013 workflow development tools
There are several tools that come together to provide a rich workflow development experience, like:
1. Visual Studio 2013:
Visual Studio 2013 can be used to develop workflows similar to SharePoint Designer 2013. Apart from that you also can develop custom actions and tasks such as a workflow action that interacts with a custom application.
2. SharePoint Designer 2013:
SharePoint Designer 2013 provides a rich set of features specifically designed for workflow development against both the SharePoint 2010 Workflow platform and the SharePoint 2013 Workflow platform.
3. Visio 2013:
Visio 2013 is an Office application that is used to build diagrams by using shapes and connectors. You can use Visio 2013 to build workflows based on the SharePoint 2013 Workflow platform. You can import workflows from Visio 2013 into SharePoint Designer 2013, and vice versa.
4. InfoPath 2013:
InfoPath 2013 is a tool designed for form development. Using InfoPath 2013 you can customize the forms that a workflow uses as users interact with it.
5. A supported web browser such as Internet Explorer, Firefox, or Chrome Web browsers will be used to to interact with SharePoint Server 2013 sites.
1. Visual Studio 2013:
Visual Studio 2013 can be used to develop workflows similar to SharePoint Designer 2013. Apart from that you also can develop custom actions and tasks such as a workflow action that interacts with a custom application.
2. SharePoint Designer 2013:
SharePoint Designer 2013 provides a rich set of features specifically designed for workflow development against both the SharePoint 2010 Workflow platform and the SharePoint 2013 Workflow platform.
3. Visio 2013:
Visio 2013 is an Office application that is used to build diagrams by using shapes and connectors. You can use Visio 2013 to build workflows based on the SharePoint 2013 Workflow platform. You can import workflows from Visio 2013 into SharePoint Designer 2013, and vice versa.
4. InfoPath 2013:
InfoPath 2013 is a tool designed for form development. Using InfoPath 2013 you can customize the forms that a workflow uses as users interact with it.
5. A supported web browser such as Internet Explorer, Firefox, or Chrome Web browsers will be used to to interact with SharePoint Server 2013 sites.
Subscribe to:
Posts (Atom)