Archive for v11

Quick Tip: CorasWorks Variables in your Path References

Now nearly two years old, you have been using CAPS, the CorasWorks API for building solutions in SharePoint, for a while; and hopefully you’re hammering out some pretty slick custom displays. However you keep running into one place you can’t leverage your CorasWorks variables, be it Global Variables or our built-in ones. Namely, how do you centralize your resource files (i.e. JS, CSS, images, etc) and yet still be able to leverage a Global Variable to reference those files?

CAPS has the answer for you: the “GetFileContents” method!

You may say “Wait, that is not right; is it…?” but it is. Normally, you might use a CorasWorks CAPS HTML Viewer to call an HTML file that is the base of your display; and to keep things clean, you reference all your dependent JS, CSS & Image files inside that HTML file. However that means that you have to reference them either via fully-qualified domain names (which then are not portable) or via relative paths, which is not always conducive to centralizing those resources. Well here is the technique…

In your CorasWorks CAPS HTML Viewer, instead of pointing directly to the HTML file (a scenario discussed in a previous blog post), make a call like this:
%SiteURL%/_layouts/CorasWorksApps/CorasWorksApplicationService.ashx?RequestType=GetFileContents&FileUrl=[Your Global Variable]/Folder/YourFile.htm

Then in your HTML file, you can now freely use references like:

<link href="[Your GV]/Folder/YourFile.css" rel="stylesheet"/>
<script src="[Your GV]/Folder/YourFile.js"></script>
<img src="[Your GV]/Folder/YourFile.png" title="Your Image">

This also open up the use of any of the built-in CorasWorks variables or your own Global Variables for anything else in that HTML page (think maybe current Username or Site Title in an <h1> tag). The reason this works is because the contents of the file – in this case, an HTML file – that is being queried via the GetFileContents method is automatically being passed through the CorasWorks variable replacement engine, thus ensuring proper translation/insertion of variable values anywhere within that HTML. And because that HTML includes those resource file URLs, their location is automatically set using those variables.

CorasWorks Global Variables permissions explained

Working within a highly secure environment recently, I had a need to detail out the effective permissions necessary to leverage the CorasWorks Global Variables (GVs) – specifically, the client wanted to understand the absolute minimum permissions needed to leverage the GVs and so I thought it worthwhile to share here.

First, know that when CorasWorks Central Configuration is first enabled on a web application, a custom list entitled “CWActionsGlobalSettings” is created within the selected Central Config site. This list will effectively store the variables in an XML blob, inside a single List Item, that is managed by the GUI that is the Global Variable Manager.

Next – and this is key – the user who creates the first GV must have at least Owner rights on the “CWActionsGlobalSettings” List. This is because upon creation of the first GV, a multi-line text column entitled “CWActionsGlobalSettings” (yes, same name as the List itself) is created within the List and the XML blob is first created, with the first GV present.

Now going forward, only Contribute rights are needed for those that you want to be able to manage GVs, as Contribute provides them insert & edit rights to that special List Item. However, because Contribute rights does not allow a user to add columns to a list, a user with those rights will not be able to create that first GV.

And finally, as is hopefully fairly obvious, any users who you want to be able to read GV values (i.e. if a GV is used in a solution they’re using), end users must have Read rights to the ”CWActionsGlobalSettings” List. The inverse is also true; if a user does not have Read rights to that list, they will not be able to see the GVs, what their value is or use any part of a solution that leverages a GV.

Who Really Needs Custom Forms on SharePoint Anyway

Right about now, a lot of IT decision makers, SharePoint users & developers are all probably thinking the same thing – that somewhere in the halls of the Microsoft campus in Redmond, somehow this idea has taken hold: that no one wants, alas needs, custom web-based forms on SharePoint.

How else do we explain the sudden, if not buried, announcement that not only has InfoPath Forms Services been extended indefinitely on O365 and included for the next release of SharePoint on-premises (i.e. SP2016), but the most promising alternative on the horizon – Forms on SharePoint Lists (FoSL) – has simply been cancelled.

Consider the facts:

  1. A few weeks before the SPC14, Microsoft makes a big announcement that they’re retiring InfoPath. They say InfoPath 2013 will be the last version of InfoPath, InfoPath Forms Services is not committed to indefinite O365 support (i.e. it will only be “supported until further notice”) and, for on-premises, SharePoint Server 2013 (SP2013) will be the last release.
  2. They heavily promote, both before & during, a session at SPC14 entitled “Update on InfoPath and SharePoint Forms – SPC348″, during which four potential alternatives are introduced, of which FoSLs receive the most attention; we actually blogged about this in the immediate aftermath of SPC14.
  3. An InfoPath “funeral” is held at SPC14, and yet very little additional information is released after the conference regarding FoSLs
  4. Then suddenly late on a Friday afternoon (February 6, 2015) – because that’s a great time to get maximum exposure on a major announcement – rather than making a new post, an “Editor’s Note” is added to the original January, 2014 article concerning the end of InfoPath, simply noting “we are also updating the timelines for removal of InfoPath Forms Services components of SharePoint and SharePoint Online.”
  5. In parallel, and not mentioned within any related post during that time, the release of FoSLs on the O365 Roadmap is abruptly moved from “In development” to “Cancelled”, which is succinctly defined as “Previously planned updates that are no longer being developed or are indefinitely delayed.”

So 13+ months removed from the news that InfoPath would no longer be updated, Microsoft has giveth then taketh away the only fully web-based form customization tool (FoSLs) they had on their roadmap, maintained the removal of Design View in SharePoint Designer 2013 and then extended the life of InfoPath – though it’s noteworthy that they did not commit to a new release, only an extension of how long & on which platforms the old/last release will be supported. Hardly a strategy any CIO/CTO I know would want to bank on.

It’s here that platforms like CorasWorks provide critical value; our existing Actions framework is a mature capability set, with nearly a decade of evolution behind it. It easily supports customizing which fields appear on a form, the order of those fields, whether or not a field is required or read-only within that form instance, customizing the description or guidance for each field using HTML rich text, triggering Workflows and even executing external service/API calls upon form submission. As the browser landscape has improved – namely IE8, the last major browser to not support HTML5 & CSS3 falls to under 3% usage worldwide – CorasWorks now looks to add even more form customization features to include more options over how forms are laid out visually, leveraging the best free frameworks on the web.

We’ll continue to track this development and the potential impacts it has; but more importantly, we’ll also continue to grow & improve our platform to meet the evolving needs of the SharePoint ecosystem, InfoPath getting a last gasp notwithstanding!

Auto-generate PowerPoint decks using CorasWorks

For everything CorasWorks can do – our visual Application Designer, reporting & dashboard wizards, Gantts, maps, grids, calendars, custom forms, workflow, integrating external data, the list goes on – I still have seen even the most savvy business user succumb to the need (or desire) make this same mistake: copy & paste data out of an application and into a PowerPoint presentation. Ugh!

CorasWorks users of the world, know you do not have to fall victim to the same trap. Working with our Services team, we can design & implement a solution that uses the CorasWorks v11 platform to auto-generate PowerPoint decks (PPTX files) in a matter of seconds and even save them directly to a SharePoint Document Library.

The design is almost elegant in its simplicity; you start with a template PPTX file that includes spaces & placeholders for the dynamic content that will be injected. Using the CorasWorks APIs, we can then load almost any data or content into the deck, including:

  • Any data within the local SharePoint farm
  • Any data within remote SharePoint farms
  • Any data within external or line-of-business systems accessible via OLEDB, ODBC, OData/REST service or SOAP web services
  • Aggregations and/or analysis of accessible data
  • Snapshot images of any CorasWorks-generated chart or Gantt
  • Copies of any image file upload to any SharePoint Library

Other key features include the ability to dynamically replicate one or more slides based on data (i.e. one slide per distinct Fiscal Year, one per Project, etc), define & pass-in variables to use in the filename and even generate “read-only” presentations that can be opened in PowerPoint & used for briefing from but cannot be modified (governance anyone…).

If you’re interested in learning more about how CorasWorks can help add not just efficiency, but consistency & governance, to your process for generating & delivering PowerPoint presentations, reach out today. Email for more info.

Tokenize Me

While working with a customer recently we wanted to pull items from multiple libraries that were similar in structure to show the current status of documents in an advanced chart.  The results of the data were to be shown in columns stacked by status by library.

How to dynamically retrieve the friendly name of the library from each item being returned in the CAPS response? An easy, yet inelegant, method is to add a text column to the libraries that simply defaults to a hard-coded value with the library’s name when a document is added.  But, why add something if it is not really needed, and what if you are dealing with more than just a few libraries?

XSLT 2.0 to the rescue.  One of the great functions of XSLT 2.0 is the tokenize function.  It is pretty easy to use, yet very powerful for a variety of tasks.  In this scenario I wanted to grab the name of the library from an item using the “FileDirRef” column and I didn’t want to apply a recursive template or such to get to it.  I wanted to keeps things as simple and lightweight as possible.  So here it is:


Just tokenize the “@ows_FileDirRef” value from the CAPS response using the “/” as the delimiter and then tell it you want the last value using the predicate filter [last()] on the result.

Happy building!

Quick Tip – Hide the browse & toggle options on a CorasWorks Calendar

Here’s a quick tip – if you want to hide the browse and toggle options on the CorasWorks Calendar…


…all you need is one line of CSS added to your target page:


The benefit to doing so is to ensure a smooth user experience when you’re say filtering the Calendar. For example, imagine I’ve applied a dynamic filter to only display items within the Current Week and also set the default display view to “Work Week” – if the user has the ability to toggle the display mode to say “Month” or “Timeline” and then also browse back or forward through time, they’re going to get an empty view (again, by virtue of the filter).

Hiding the browse & toggle options simply ensures they stay within the time frame and display mode that Calendar is targeted to; after all, the Calendar itself and the Design Canvas make it quick & easy to create similar Calendar views with different filter ranges and display modes.

Adding the CSS rule can even be done directly through the webpart as well; just open the web part properties (the native SP “Edit web part” option, not the CorasWorks Display Wizard) and add the CSS within a <style> tag to the “HTML Before” or “HTML After” properties and you’re set. Now the web part can even be placed into the Web Part Gallery with this customization set for use throughout your Site Collection.

Access the URL of a file in a Document Library via Lookup

This was one of those “I can’t believe it works this way” moments in SharePoint; if you’ve spent anytime architecting or building applications on SP, you know the feeling I’m talking about.

I had a simple scenario of wanting to allow users to easily link items in a List to a file in a Document Library; however, rather than requiring they copy-paste the URL to the file (manually or otherwise) within the List item, I wanted to use a Lookup. Worked great at the UI layer for end users; however, as soon as I tried to build a display that leveraged the JOIN ability within the CorasWorks API to pull the file URL based on the Lookup value, I hit a wall – any & all fields that contained some or all of the file name or path cannot be queried via the SPQuery.Joins property. I tried them all, including the most obscure of internal system fields like “LinkFilename2″ but none worked.

A quick search of the web revealed I was not alone; even worse, all the solutions I could find required custom workflows or even custom code and all followed the same pattern – create some event handler to grab the URL of a file after upload & write it to another field. Sure it would work, but getting any custom code installed on this client’s server is not easy and requires a multi-week CCB process. All that just to get the URL of an item I already have a Lookup relationship for?!

Then I had an idea: I knew our CorasWorks Actions provided direct and easy access to any field on a List or Library item, including all hidden & internal system fields. So I took the equally direct and easy approach to solving the problem – I created a Set File URL Action (a CorasWorks Modify Item Action) that wrote the “Server Relative URL” for a document into a field I can access through the JOIN on my query.


I then created a List Activation that automatically runs said Action every time a file is added to the Document Library and I’m set – no custom coded event handlers or workflows to have to write & deploy. Another streamlined solution thanks to CorasWorks!

What is the CorasWorks CAPS HTML Viewer web part?

If (hopefully when) you upgrade to CorasWorks v11.3.2, you may have noticed a new web part available to you: the CorasWorks CAPS HTML Viewer.

Great! But was is it…? If you’ve ever used the native Content Editor Web Part (CEWP) to load an HTML file from a Library via the Content Link property, then prepare to upgrade your experience! There are three main limitations to using the CEWP in this way; one, it cannot load an HTML file that is not on the local site (i.e. the same site where the web part resides) unless you’ve enabled Anonymous authentication. This means if you have some centralized content in an HTML file you want to display across multiple sites, you’ll have to enable Anonymous authentication or the CEWP will display a message saying it cannot load the content [Reference here, in the IMPORTANT tag].

Second, also on that same Reference page under the NOTE tag is this quote: “If you enter a URL into the Content Editor Web Part as a relative link, the link converts to an absolute URL when the entry is saved.” It then goes on to say if the page the CEWP is on will then be moved (think DEV to QA/Staging to PROD) “…you will need to edit the Content Editor Web Part on the production server and update the URLs manually.” Eek!

Finally, say you want to point to some endpoint (wink wink, CAPS call) that dynamically generates some HTML – so instead of a static HTML file, you want to inject dynamic HTML into a page via web part. The CEWP simply does not support this; use the Content Link property to point it to a Service/API that generates HTML and it will fail to display it.

Fortunately, the CAPS HTML Viewer address all of these limitations. First, not only can you use it to point to any HTML file anywhere within your SharePoint farm – you can do so without having to enable Anonymous authentication.

Additionally, it supports all the CorasWorks built-in variables as well as any Global Variables within your URL. So no more worries about the CEWP converting your relative URLs to absolute ones.

Finally, it fully supports loading dynamic HTML (again, generated via CAPS or any other capable Service/API) into a page; so you’re no longer limited to static HTML files.

No more will you be limited by or struggle with the Content Link property of the Content Editor Web Part – let the CAPS HTML Viewer unlock the full potential of your application design.

Video Embed code (YouTube, Screencast, etc) in SharePoint list items

Ever try to put some embed code into a Multiples lines of text field in SharePoint? If so, chances are you didn’t get the expected result (unless your goal was to display raw HTML & not the embedded video). Your first reaction might be to think, no problem, there’s three different ways to configure a Multiple lines of text field – one has to work, right? Unfortunately not :/

The three options are “Plain Text”, “Rich Text” and “Enhanced Rich Text” – when you try to paste in say the embed code for a YouTube video, your results will be…

  • Plain Text: The raw HTML is saved but it’s also displayed in the Item Forms & List Views, instead of seeing the embedded video.
  • Rich Text: The embed HTML cannot even be saved; if you paste it into the field, when the item saves, it will be stripped out.
  • Embedded Rich Text: This one seems to have the most promise because you can access the “HTML Source” box for the field; not only that, if you post the embed code into the HTML Source, you’ll see the embedded video while still in the List Item form – yay! Save it though, and the embed code is again removed.

You’ll see these results reflected in the screenshots to follow; of the native options, only the field configured as “Plain Text” will even retain the embed code that was pasted in.

So what’s a user to do? Ask IT for a custom coded solution just to display some embedded videos? Hack together something with Content Editor web parts (great for a single video, but what if you need to manage a CMS and video library…)? Buy a solution to stream videos from the SharePoint server (you really want to tax your SharePoint WFEs with video streaming, not to mention YouTube’s player & compression algorithm is world class and likely to perform better…)?

How about a 4th option that makes it as easy as it should be – copy/paste the embed code into a field in the list item & have it just work. Enter the CorasWorks Workplace RTF field!


Our Workplace RTF field not only allows you to paste video embed HTML into it but, when you do, the embed content is displayed & maintained throughout the Item View & Edit forms (of course, it also works in the CorasWorks Actions).



And while the native List Views aren’t capable of rendering the embedded HTML…


…fortunately, our smart Grid is:


All told, creating a solution for tracking, managing and displaying your videos from any number of premier video streaming services is now quick & easy with CorasWorks!

Using jQuery to create a slide-left-and-fade effect

A couple years ago I had the idea of adding a UI effect to an application I had built (a lightweight Task board) that mimicked the notification bar in Android – specifically, an item could be “swiped” off the board and the DIV representing the item would have an animation sliding left (or right) while also fading out.


Accomplishing that effect was as simple as one line of jQuery:


That’s it! You can then implement this upon any sort of event or user interaction (mine happens here upon clicking a “Mark Complete” button) and you’re set.

And for those wondering what makes it all work, the .stop() ensures no conflicting animations are being run (this particular application allows users to re-order & shuffle their board) and the animation itself handles the sliding & fading out via the “left: ‘-=600′” (move the element 600 pixels to the left of where it currently is) & “opacity: ‘hide’” (change the opacity to hide the element) properties.