Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to create SharePoint Hosted App development environment and deploy a SharePoint Colored Calendar - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2013-06-24

After setting up my environment for SharePoint app, I was thinking about writing my first app for SharePoint. After a long weekend thinking to find my first  “Hello World” kinda app, I came across this Color Calendar solution on one of my great friend Mark Wilson’s blog. Kindly, he has agreed to use his idea to try it on my first SharePoint app and here is it below…

Just before going into the details, please find the environment details which I used for the Color Calendar app.

Environment Details: (Setup – Configure App environment)

  • Web Application  and a Root Team Site (ex: http://win-2j3idcdeuh6/)
  • App Catalog site the above web application (ex: http://win-2j3idcdeuh6/sites/apps/_layouts/15/start.aspx#/AppCatalog/Forms/AllItems.aspx)
  • App DNS (ex: sp.apps.local)
  • App DNS Prefix (ex: spapps)
  • Visual Studio 2012 with the SharePoint 2013 App add-ins

What is Color Calendar?

Step 1:

  • Create a new Project “ColorCalendar” with the option “App for SharePoint 2013”
  • Select the Site and the Type of hosting as below

  • Note: The types of App hosting details can be found here

Step 2:  Create a Custom List based on the calendar list

  • Right Click on the “ColorCalendar” project and Add a new List

  • Click Next and Select the Custom List template option as “Calendar” as below

  • Click Finish.

  • Amend the List Schema to include a Calculated field as below
  • <Field Type="Calculated" ID="{2A55D341-73C9-4df9-8BC6-F9A754A08F82}" Name="CategoryTitle" DisplayName="CategoryTitle" ResultType="Text" ShowInDisplayForm="FALSE" StaticName="CategoryTitle">
            <Formula>= "|||" &amp; [Category] &amp; "|||" &amp; [Title]</Formula>
            <FieldRefs>
              <FieldRef Name="Title" />
              <FieldRef Name="Category" />
            </FieldRefs>
          </Field>

     

  • Amend the “Calendar” view as below
  •   <ViewData>
              <FieldRef Name="CategoryTitle" Type="CalendarMonthTitle" />
              <FieldRef Name="CategoryTitle" Type="CalendarWeekTitle" />
              <FieldRef Name="Location" Type="CalendarWeekLocation" />
              <FieldRef Name="CategoryTitle" Type="CalendarDayTitle" />
              <FieldRef Name="Location" Type="CalendarDayLocation" />
            </ViewData>

     

  • Amend the Default.aspx to include a webpart zone (to display the Calendar – ListView webpart) and a JS section to implement the ColorCalendar functionality
  • Amend the App.Js to include the ColorCalendar functionality

  • Amend the Page element.xml to include the ListView Webpart as below

Step 3 : Compile the solution

  • Compile and Publish the project.
  • The output will be “ColorCalendar.app”

Step 4: Publish the app to the catalog site

  • Go to the App Catalog site (ex: http://win-2j3idcdeuh6/sites/apps)
  • Click “App for SharePoint” -> “New app” -> Upload the “ColorCalendar.app”

  • Click Save

Step 5: Add the ColorCalendar app into the site

  • Go to the Site (ex: http://win-2j3idcdeuh6/) and Click “Site Contents”
  • Click “Add an App” option

  • Click the “ColorCalendar” app and Click “Trust It”

  • App is installed and ready to use

Step 6: Click the installed app…

  • Add an event to the Calendar and there you go….we have a Color Calendar…

Conclusion :

Sample Code:

And Once again, I would like to thank my friend and colleague Mark Wilson for his support and allowing me to use his code on this blog. More details about the ColorCalendar script can be found here.

(Visited 303 times, 1 visits today)

About the author 

Balamurugan Kailasam

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.