Welcome control is normally present in layouts/controltemplates folder. To create new item in welcomecontrol, take a backup of existing control and work on the backupfile. Do not modify the welcome control file directly. Below are steps to create new link in contextual menu of welcome control.
1. Take a backup of existing welcome control
2. In <CustomTemplate> tag , add below line of code for the new link
<SharePoint:MenuItemTemplate runat="server" id="NewLink"
Text="New LInk"
Description=New LInk"
MenuGroupId="300"
Sequence="1001"
ClientOnClickNavigateUrl="~site/_layouts/15//NewLink.aspx"
HiddenScript ="GetLinkVisibility();"
/>
where
ID - Id of contextual menu
Text - Text to be displayed
Description - Description of the menu item
MenuGroupId - Id of the group in which the link is to be displayed
Sequence - Sequence order in which the link is to be displayed. Increment the order from the last menu item
HiddenScript - Calls javascript method which will return values (true or false) to set visibility of the link
3. If link is to be displayed based on certain user permission, write the c# code at top as below
<script type="text/javascript">
var linkVisibility;
function SetLinkVisibility(reportVisiblity) {
if(reportVisiblity=='visible')
{
linkVisibility=false;
}
else
{
linkVisibility=true;
}
}
function GetLinkVisibility()
{
return linkVisibility;
}
</script>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
if (!Page.IsPostBack)
{
SPSite site = SPContext.Current.Site;
SPWeb web = site.OpenWeb();
SPRoleDefinitionBindingCollection usersRoles = web.AllRolesForCurrentUser;
SPRoleDefinitionCollection roleDefinitions = web.RoleDefinitions;
SPRoleDefinition roleDefinition = roleDefinitions["CustomPermissionLevel"];
if (usersRoles.Contains(roleDefinition))
{
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "visiblelinks", "javascript:SetLinkVisibility('visible');", true);
}
else
{
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "hidelinks", "javascript:SetLinkVisibility('hidden');", true);
}
}
base.OnLoad(e);
}
</script>
4. Update the reference of the welcome control in master page.
Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts
Friday, February 06, 2015
Wednesday, December 10, 2014
SharePoint Publishing Workflow - The workflow could not set content approval status. Enable content moderation for this list and run the workflow again.
This is regarding SharePoint Out Of Box Publishing Approval Workflow issue in SharePoint 2010.
1. Add an Out of Box Publishing Approval workflow to a SharePoint document library (e.g Pages)
2. Create a Page and Publish the page.
3. The workflow assigns task to Content Approver to Approve/Reject the changes
4. When the Content Approver approves/rejects the page, the status is updated as Approved/Rejected.
5. But when we navigate to the page, it still shows "Waiting for approval".
The issue occurs in April 2012 CU of SharePoint 2010 (version 14.0.6120.5000).
To fix the issue, install the higher version of CU or register older version of dll of Microsoft.Office.Workflow.Actions.dll (14.0.6108.5000) in GAC
Reference
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/e87c50e0-e7ed-41f0-bdb5-b16a3cf6828d/ootb-workflow-gives-error-when-user-rejects-in-the-document-in-publishing-a-major-version
1. Add an Out of Box Publishing Approval workflow to a SharePoint document library (e.g Pages)
2. Create a Page and Publish the page.
3. The workflow assigns task to Content Approver to Approve/Reject the changes
4. When the Content Approver approves/rejects the page, the status is updated as Approved/Rejected.
5. But when we navigate to the page, it still shows "Waiting for approval".
The issue occurs in April 2012 CU of SharePoint 2010 (version 14.0.6120.5000).
To fix the issue, install the higher version of CU or register older version of dll of Microsoft.Office.Workflow.Actions.dll (14.0.6108.5000) in GAC
Reference
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/e87c50e0-e7ed-41f0-bdb5-b16a3cf6828d/ootb-workflow-gives-error-when-user-rejects-in-the-document-in-publishing-a-major-version
Create Reminder mails on Task List
Below are Out of Box steps to send task due reminder mails in SharePoint. The below approach is applicable for both SharePoint 2010 and SharePoint 2013.
1. Create Task list
2. Create a workflow using SharePoint Designer to send emails to users. Include condition to send mails only for due tasks/overdue tasks
3. Uncheck all the checkboxes in Start Options for the workflow
4. Publish the workflow
5. In Task list navigate to List Settings
6. Click on Information management policy settings - >Task
7. Click on Enable Retention
8. Click on Add a Retention stage

9. Enter settings for Time Period as Due Date + 0 days
10. In Actions, select Start a workflow and select the workflow created
11. If reminder mail is to be sent every day, then check the checkbox for Recurrance and enter 1 day
12. Navigate to Central Admin -> Monitoring
13. Click on Review Job Definitions
14. Click on Information Management Policy .
15. Configure it to run Daily. Default setting is to run every Friday at 11 pm
16. Click on Expiration Policy
17. Configure it to run Daily, couple of hours after Information Management Policy runs. Default setting is to run every Saturday at 11 pm
Below are Out of Box steps to send task due reminder mails in SharePoint. The below approach is applicable for both SharePoint 2010 and SharePoint 2013.
1. Create Task list
2. Create a workflow using SharePoint Designer to send emails to users. Include condition to send mails only for due tasks/overdue tasks
3. Uncheck all the checkboxes in Start Options for the workflow
4. Publish the workflow
5. In Task list navigate to List Settings
6. Click on Information management policy settings - >Task
7. Click on Enable Retention

9. Enter settings for Time Period as Due Date + 0 days
10. In Actions, select Start a workflow and select the workflow created
11. If reminder mail is to be sent every day, then check the checkbox for Recurrance and enter 1 day
12. Navigate to Central Admin -> Monitoring
13. Click on Review Job Definitions
14. Click on Information Management Policy .
15. Configure it to run Daily. Default setting is to run every Friday at 11 pm
16. Click on Expiration Policy
17. Configure it to run Daily, couple of hours after Information Management Policy runs. Default setting is to run every Saturday at 11 pm
18. Now the reminder mails will be sent daily once the tasks are due till its completed
References
Subscribe to:
Posts (Atom)











