Email Enabled Calculated Fields

10 05 2017

I am back! Today I am going to show you how to use calculated fields to form an email address and a clickable link to send to that email address you just created.
The ask was to create a custom list that had the following fields:
Cost Code
Address
Location City
State
Phone
Manager
This information just happened to be avaialable in another SQL database, so rather than populate it it manually, I decided to go BCS all over that sucker. BUt, that’s not what we will talk about today.
Once that information is safely in SharePoint via external contentype, I used 2 calculated columns to get the email and the mailto link.
The first calculated column was used to concatenate the cost center and location to form the much needed address. So if you are following at home create 2 calculated columns.
The first colum will take Cost Code and Location city, mash them together and spit out an email address the address in the following format store40001portland@mystore.com
Since i have no column named store, i will just hard code it in. Here is the email formula:
=CONCATENATE(“STORE”,[Cost Center],Location_City,”@mystore.COM”)

Now, to make it a clickable mailto link, i really had to mess with the html. For your second calc column add this formula:
=CONCATENATE(“Email“)

You guessed it, EMAILCALC is the name of the first calc column.
that’s it.
Love me.
Nando

Advertisements




Buttons, Buttons, Buttons.How to create a Sp 2013 Javascript button to create a new doc

6 04 2016

You know what’s not so easy in Sp2013? Newform.aspx urls. Sure they live in the document library ribbon.
Sure you can also just drag stuff in, but what if you want to create a custom page and make it even easier for your users to create a new document?
That’s not so easy. So i set about figuring out the best way to do this.
Javascript buttons look cool and professional, so I thought, hey why not.
So I scoured the interwebs for some code. I came across this Gem by Ahmed Farag:
https://blogs.msdn.microsoft.com/how24/2014/09/23/create-a-link-to-display-edit-and-create-new-items-from-a-dialog-layover-in-sharepoint/
Thanks Ahmed you got me started!
This is an elegant solution if your library is out of the box. But what if you have custom content types?
That is not so easy to figure out. Once i did figure it out it was easy but not at first. You see, if you add a custom content type to a document library, the content type lives in _layouts, not in list/library name.
So how do you link that?
Well my friends, I am glad you asked.
First things first, like Ahmed says, grab yourself a content editor webpart (not script editor, that one has issues) and add it to a page.

Open your fav notepad editor
Copy Mr. Farag’s elegant code into it and click save.

 

(script type="text/javascript")
 function displayLayover(url) { 
 var options = SP.UI.$create_DialogOptions(); 
 options.url = url; 
 options.dialogReturnValueCallback = Function.createDelegate( 
 null, null); 
 SP.UI.ModalDialog.showModalDialog(options); 
 } 
 (/script)
Upload to your site asset library and link it via web part editor propeties
Now you have a pretty nifty button, but it doesn't do anything.
According to Ahmed, you should add the HREF key after your code for newitem.aspx.
However, as I alluded to early, that's not going to fly if you have a custom content type.
So here is his code:
<a href='javascript:displayLayover("/Lists/Contacts/NewForm.aspx?IsDlg=1")'>Display Item </a>
As you will figure out, content types do not live in /list/, they live in _layouts. So, how do i get that darn URL?

Its actually stupid simple. 
Basically, all you have to do navigate to your library settings, advanced settings, and find the open forms in dialogue, and click no.
Go back to your library and click new document and select your custom content type.

That will open your new item in a page, where, gasp, you can copy the url and past it into Ahmed code.

<a href='javascript:displayLayover("http://mysharepoint.domain.com/_layouts/15/NewDocSet.aspx?List=bc691a02%2D6335%2D4aee%2Da0e8%2D70185ab0491e&Source=http%3A%2F%2site%2Edomain%2Edomain%2Ecom%2F15%2Fnewlibrary%2FForms%2FAllItems%2Easpx&ContentTypeId=0x0120D520006B5814CAEDD0FD4C8F8F5C6B8AD7978C00F45CB6B8B2D5A74C8046CA70881BB0F7&RootFolder=%2F15%2Fputthisinyournewlibrary")'>New Content Type </a>

That's it. Now you have a new button that creates your new content type.

Tips: Make sure when you use content editor you upload your code to the asset library and link the file inside the content editor, so you can edit it easier.

TIP: Turn on versioning in your asset library so you can version your code out.

 

You are welcome world!

Nando






SharePoint Logos: One logo to rule them all.

13 05 2015

I have been racking my brain trying to figure out a way to force all sites in my SharePoint farm to use the same logo. Obviously I should have stapled it to my master page before pushign it out, but as usual I suck.
So i decided to break out the old PowerShell machina and take a crack at it.
I found a bunch of sites that showed how to do this for all SUBSITES in a Site Collection, but not all Site Collections and subsites.
Here is what I came up. Hope it works for you guys.
This code is as is and I don’t take any responsibility for screwing up your farm.

$sitelogo=”SPSITE where your logo resides usually _layouts/site assets/”

$Site=”http://rootsite

$Sites=Get-SPWebApplication $Site|Get-SPSite -Limit All |Get-SPWeb -Limit All|Select URL

$Sites|ForEach-Object {

$CurrentSite=$_.URL

$CurrentSiteObject=new-object Microsoft.SharePoint.SPSite($CurrentSite)

foreach($web in $CurrentSiteObject.Allwebs) {

$web.SiteLogoUrl=$sitelogo

$web.Update()}

$CurrentSiteObject.Dispose()}

Happy SharePointing!

KTHANKSBYE
Nando





Sp 2013 WFE workflow hell.

30 01 2015

I am back fellow readers. Back with a vengeance.
Currently, I am in possession of one BIG SharePoint 2013 farm with a total of 24 server between prod, sys and dev.
The production farm is a 9 SP farm behemoth.
So it began with a simple enough requirement, please demo SharePoint 2013 workflows. I said OK and tried to create one.
Nope.
Tried another site.
Nope.
Spent 6 hours on the phone with Premier.
Nope.
Slept on it and guess what occurred to me. I should check all WFE to see if they have workflow manager CLIENT installed.
They didn’t.
Now they do.
Tried workflows again.
YUP. They work.
So WFE workflow hell, i see you now.
Enjoy my fail.
Yours truly,
Nando





Dynamic Link to a specific Infopath Form View using a SP Workflow

11 12 2013

I had a requirement to create an infopath form for a client for assigning security badges. Not a difficult thing to do, I said. But as I gathered the requirements, and confidently shook my head back and forth saying, YES WE CAN!, I realized something nagging in the back of my mind.
I of course paid no attention to it and got to work on the infopath form.

It was nothing complex, just a user input form and an approval section at the bottom for official use only. But then that a fore mentioned nagging feeling, finally surfaced. I was going to have to use infopath views to hide the official use only section from the user. Simple enough for infopath, but now i had to surface a link to that view in a custom workflow email. That one took a bit of investigation, but i found 2 solutions for this. I will give credit to both parties, but i had to combine them to create one DOJO worthy Solution.

The first part of the solution can be found here. Kudos to  S.Y.M. Wong-A-Ton  for blogging about this.

http://www.bizsupportonline.net/browserforms/create-sharepoint-designer-workflow-send-email-link-infopath-browser-form.htm

The second part of the solutions comes courtesy of the wonderful Laura Rogers. Nicely Done!

http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=daba3a3b-c338-41d8-bf52-cd897d000cf3&ID=133&Web=dbb90e85-b54c-49f4-8e97-6d8258116ca0

Here is how I did it.

  1. First in SharePoint Designer 2010 i created a simple condition :
  2. “if current item equals value then Email a user”
  3. step1
  4. In the email editor I created a custom link and in the string builder i copied the following url and filled in the blanks.
  5. http://ServerName/SiteName/_layouts/FormServer.aspx?XmlLocation=[INSERTLOOKUP] &Source=http%3A%2F%2FServerName%2FSiteName%2FLibraryName%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1
  6. From the string builder I clicked on add or change lookup and inserted the following in the [INSERTLOOKUP] referenced above.
  7. Data Source = Current Item
  8. Field From Source = Server Relative url. step3
  9. The new Url should look like this:
  10. step2
  11. I adde a reference to the hidden view using : &DefaultView=hiddenview
  12. Save and publish the Rule and test it out.
  13. The url link should open the infopath form with the new default view.

VOILINS……i mean voila.
Enjoy
Nando

 

 





SharePoint 2013 and office web apps; the hidden truth about how to install!

23 07 2013

I make it a habit to write about things that trip me up about SharePoint and almost always, I have had a pretty good idea as to why. But, this time I have come across something that I do not understand.
OFFICE WEB APPS 2013 DOES NOT LIKE TO BE INSTALLED ON ANYTHING BUT THE C DRIVE.

Yes ladies and gentlemen, installing office web apps 2013 on the d: drive will not fully work. Word Web app will start to work and then hang for 5 minutes and tell you that the service is busy.

The only known fix that i have come across is to uninstall owa, unbind, then reinstall on the c drive, rebind and bingo it works.

Why? I have no idea.

Hope this helps you guys out.

Nando