Month: June 2014

I just moved to my new domain to

Posted on

Finally, I was able to configure my own domain with wordpress, after 10 years blogging I have tried many platforms, I tried blogger, wordpress, then blogger again, then wordpress, then sharepoint.

Sharepoint as a blogging platform is very limited, specially in Office 365, you need to customize a lot and that takes a lot of time.

Blogger is really a blogging platform, better than Sharepoint, but the Theme choice and plugin choice is very limited.

WordPress hosted at really sucks if you need to paste some code, as you cant install plugins, you are stuck.

Thats why I moved to wordpress in my own server, because I can install any plugin and use any theme.

So, welcome to my new blog @


Posted on

Enabling PDF Preview is a must in today’s environments.  We have used Sharepoint 2013 for over 1 year and we didnt have this feature, we never thought it could be possible because well, the name is called “Office Web Apps”, but indeed is possible and straightforward.

Please note the solution below only works if you have office web apps, March 213 PU.



1. Execute the following script.

2. Dont forget to run a full crawl afterwards

$tenantOwner = Get-SPEnterpriseSearchOwner -Level SSA $ssa = "Search Service Application" #change if you have a different name $rule = get-SPEnterpriseSearchPropertyRule -PropertyName "FileType" -Operator "IsEqual" $rule.AddValue("pdf") $ruleCollection = Get-SPEnterpriseSearchPropertyRuleCollection $ruleCollection.Add($rule) $item = new-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication$ssa -Name "PDF with Preview" -Rules $ruleCollection -RulePriority 1 -DisplayProperties "Title,Author,Size,Path,Description,EditorOWSUSER,LastModifiedTime,CollapsingStatus,DocId,HitHighlightedSummary,HitHighlightedProperties,FileExtension,ViewsLifeTime,P arentLink,ViewsRecent,FileType,IsContainer,SecondaryFileExtension,DisplayAuthor,docaclmeta,ServerRedirectedURL,SectionNames,SectionIndexes,ServerRedirectedEmbedURL,S erverRedirectedPreviewURL" -DisplayTemplateUrl "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word.js" -OptimizeForFrequentUse $true

solving error signing credentials was not initialized on sharepoint provider apps

Posted on

Today I was trying to create a sharepoint provider hosted app by using many of the blog posts and tutorials on the web.

​​​The code I was using was:

Uri hostWeb = new Uri(Request.QueryString["SPHostUrl"]);
using(var clientContext=TokenHelper.GetS2SClientContextWithWindowsIdentity(hostWeb,Request.LogonUserIdentity))
var web= clientContext.Web;
clientContext.Load(web, w=>w.Lists.Include(l=>l.Title).Where(l=> !l.Hidden));
return View(web.Lists);


The exception was thrown explicitly by the TokenHelper Class





​Well, if you analyze the code for a second the name of the method is GetS2SClientContextWithWindowsIdentity, but I am creating a Sharepoint Online Provider Hosted App.

Does it make sense to get the client contex from a windows identity? obviously it does not.

After investigating for some minutes, I found there are other methods in the token helper class, and the one below makes more sense, doesnt it?

var contextToken = TokenHelper.GetContextTokenFromRequest(Request);
var hostWeb = Request.QueryString["SPHostUrl"];
using (var clientContext = TokenHelper.GetClientContextWithContextToken(hostWeb, contextToken, Request.Url.Authority))
var web = clientContext.Web;
clientContext.Load(web, w=>w.Lists.Include(l=>l.Title).Where(l=> !l.Hidden));
return View(web.Lists);

The option for the Sharepoint 2013 workflow platform is not available because the workflow service is not configured on the server

Posted on

​​I have correctly configured Sharepoint 2013 Workflow Manager, however I was not able to create workflows with Sharepoint Designer using the 2013 option.


See my previous posts here:

1. How to install workflow manager offline

2. How to install workflow manager ​


After several hours looking for documentation and asking on stackexchange​​, I was able to fix it.

Thanks to Cameron Verhelst​.​



​You have to enable a feature on the site where you want to create the Sharepoint 2013 Workflow.


Enable-SPFeature -Identity WorkflowServiceStore –Url $yourUrl​​


Add callout cu​stom action based on content TYPE

Posted on

I had a strange requirement this week.  We have a document library with 3000 items where there is a workflow that was approved by the users some months ago, the workflow is quite complex.

However after some months using it, the users complain that some documents dont need the long approval and can just go to Completed.

The status field is of course a hidden field, so they cant just modify it, normally the workflow would update this field for the users.



​​Create a callout custom action, for those who dont know the callout its the small pop window that appears when you click on the 3 dots in a document library item.

Callouts are not limited to list items, they can be done everywhere in every element you want, and they are used extensively in search results as display templates.

In  my case I didnt need to put the custom action in search results, just in the document library.


​​1. ​add code snippet webpart

​The code below is for a normal document library, as I was working during the weekend at home, I did it on my sharepoint online (Documents Library),  but in your environment you only need to change the list title and the field you want to change.

SP.SOD.executeFunc("callout.js", "Callout", function () {
var itemCtx = {};
itemCtx.Templates = {};
itemCtx.BaseViewID = 'Callout';
// Define the list template type
itemCtx.ListTemplateType = 101;

itemCtx.Templates.Footer = function (itemCtx) {
return CalloutRenderFooterTemplate(itemCtx, AddCustomCompleteAction, true);


function AddCustomCompleteAction (renderCtx, calloutActionMenu) {
if(renderCtx.CurrentItem.ContentType=='Document') {
calloutActionMenu.addAction (new CalloutAction ({
text: 'COMPLETE',
tooltip: 'This action will set status to Complete, this action cant be rolled back.',
onClickCallback: function() {UpdateBillCycleStatusToCompleted(1);}

// Show the default document library actions
CalloutOnPostRenderTemplate(renderCtx, calloutActionMenu);

// Show the follow action
calloutActionMenu.addAction(new CalloutAction({
text: Strings.STS.L_CalloutFollowAction,
tooltip: Strings.STS.L_CalloutFollowAction_Tooltip,
onClickCallback: function (calloutActionClickEvent, calloutAction) {
var callout = GetCalloutFromRenderCtx(renderCtx);
if (!(typeof(callout) === 'undefined' || callout === null))
SP.SOD.executeFunc('followingcommon.js', 'FollowSelectedDocument', function() { FollowSelectedDocument(renderCtx); });

function UpdateBillCycleStatusToCompleted(itemId) {
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Documents');
this.oListItem = oList.getItemById(itemId);
oListItem.set_item('Title', 'Complet');
clientContext.executeQueryAsync(Function.createDelegate(this, this.StatusCompletedSucceeded), Function.createDelegate(this, this.StatusCompletedFailed));

function StatusCompletedSucceeded() {
alert('Item updated!');

function StatusCompletedFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());

function IsCurrentUserMemberOfGroup(groupName, callback) {
var currentContext = new SP.ClientContext.get_current();
var currentWeb = currentContext.get_web();

var currentUser = currentContext.get_web().get_currentUser();

var allGroups = currentWeb.get_siteGroups();

var group = allGroups.getByName(groupName);

var groupUsers = group.get_users();


function OnSuccess(sender, args) {
var userInGroup = false;
var groupUserEnumerator = groupUsers.getEnumerator();
while (groupUserEnumerator.moveNext()) {
var groupUser = groupUserEnumerator.get_current();
if (groupUser.get_id() == currentUser.get_id()) {
userInGroup = true;

function OnFailure(sender, args) {

​2. next challenge.

​Now I need to show the option based on the current user group, if the user its in a specific group, then show the custom action, otherwise dont show it, that will be my next blog post.


Hope you enjoy it, I had fun times coding this.

Thanks to : @eliostruyf​​​


Posted on Updated on

Yesterday, when I was trying to Install Workflow Manager via powershell I had the following issue:

Cannot validate argument on parameter ‘SBClientConfiguration’. The Service Bus connection string contains invalid property.

The thing is that when you install workflow manager with the offline web platform installer: see here
At the end of the process, the wizard will open.
There is a trick with this wizard, you cant edit the database names, and if you are like me where you share the sql instance with other development environments, then it doesnt make any sense to use those database names.
So, I tried the copy powershell commands option, and ran it.  Then it failed with the error  here.
However, I noticed then, there is a new tool installed the workflow configuration manager, and in there you have the option to create a new workflow farm, and update the DB settings
Please note this wizard is different to the wizard started at the end of the installation process, this wizard allows you more control (change DB Names)
This post helped me a bit:

– See more at:


Posted on

f you are as unlucky as me, then you are in a very restricted environment where the dev servers dont have internet connectivity.

In this case you need to install both WorkflowManager and WorkflowManagerClient and WorkflowManagerTools in your environment offline.

WebPlatform Installer is not an option (not online)

How to fix this:?

1. Dowload them offline:

webpicmd /offline /Products:WorkflowManager /Path:C:\temp\WorkflowManager

webpicmd /offline /Products:WorkflowManagerTools /Path:C:\temp\WorkflowManagerTools

2. Copy the files to your server

3. Install them using webplatform installer on the server, please note you need to install this first on the server even if you dont have internet connectivity you can use command line arguments to intall offline:​

4. Install the components

WebpiCmd.exe /Install /Products:WorkflowManager /XML:c:/temp/WorkflowManager/feeds/latest/webproductlist.xml

WebpiCmd.exe /Install /Products:WorkflowManagerTools /XML:c:/temp/WorkflowManagerTools/feeds/latest/webproductlist.xml

Please note that the first command will run a wizard at the end to join the workflow manager into the farm, I am still struggling with this step, will post something later

– See more at: