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





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





View HTML pages in SharePoint Online.

23 07 2014

Did someone in your organization save an entire website in a document library?
Did they complain they couldn’t open the start.html page?
Do you have users that want to view html pages inside SharePoint online?
If you answered yes to any of these questions (i am aware of the irony of this post), then I have a solution for you!
Simply open your html files in your library using explorer view and change the extension from HTML to ASPX. It even works with Flash content.
Yup, its that easy (and confusing at the same time, but for other reasons).

Enjoy
Nando





CSGPRO Guest Blogging

11 06 2014

As a new member of the CSGPRO team, I have committed to posting more Office 365 blogs.
Here is a dandy one for anyone about to migrate to the cloud.
Enjoy the goodness.
http://www.csgpro.com/post/110085

Nando
ps, yes thats me.