Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Add Email functionality to Discussion Thread Context Menu

  Asked By: Eddy    Date: Jan 14    Category: Sharepoint    Views: 2465

Wanted to share with the group.

Business requirement was to add Email functionality to Discussion Thread Context Menu.
Based on Mark Bower http://blogs.msdn.com/bowerm/articles/175691.aspx Customizing Context Menus for document libraries, it is easy to add this functionality to discussion threads.

Three ways :
1. Add the code to ows.js file.
2. Create your own custom ows.js file. //Best way and will be available globally.
3. Use CEWP to override function AddListMenuItems(m, ctx)

function AddListMenuItems(m, ctx)
{

if (typeof(Custom_AddListMenuItems) != "undefined")
{
if (Custom_AddListMenuItems(m, ctx))
return;
}
if (ctx.listBaseType == BASETYPE_DISCUSSION)
{
// custom code begins
var strDisplayEmail = "Email this thread...";
var br = escapeProperly("\n");
var emailTo = " mailto:%20?subject=";
var myStrImage = "";

var myAction ="window.navigate('"+emailTo+itemTable.Subject+"&body=Title of the Discussion: - "+itemTable.Subject+br+br+escapeProperly( ctx.displayFormUrl)+"?ID="+ currentItemID + "&Source=" +GetSource()+"')";

CAMOpt(m, strDisplayEmail, myAction, myStrImage);

//custom code ends

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Add Email functionality to Discussion Thread Context Menu Or get search suggestion and latest updates.




Tagged: