SharePoint 2010: Usage files are not deleted, causing timer service problems.

On a SharePoint Server 2010 server, the Usage Provider (.usage) files are not deleted from the file system. Additionally, the .usage files keep growing.

 

The ULS logs are filled with the below errors :

 

Trace Management Service unable to delete file ‘D:\APPS\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\IPW-SPWFE01-20160328-1257.usage’.  Error 00000020

 

To clear the old .usage files from the file system, I had to restart the SharePoint Timer Services. The .usage files were not getting automatically deleted and this is a known issue.

 

MS recommends the below action to fix this:

  1. Installing December 2013 CU for SharePoint 2010 (I would not recommend this )
  2. Set up a scheduled task to manually recycle the timer service (at least) once a day — every 4 to 6 hours would be better. 

 

You can use a PowerShell command like this to recycle the service:

restart-service -Name SPTimerV4

 

Then you just need to set up a scheduled task to run it every 6 hours on every SharePoint server in the farm.

When the timer service is manually recycled, the open handles to the .usage files are released, and they will be automatically deleted when the next instance of the Usage Data Import timer job runs (by default every 30 minutes).

 

There should be no need to manually delete the files or restart the services.

 

fix vertical scroll issues + SP 2010

var elmRibbon=GetCachedElement(“s4-ribbonrow”);

var elmWorkspace=GetCachedElement(“s4-workspace”);

var    vph=GetViewportHeight();

var newWorkspaceHeight=vph – elmRibbon.offsetHeight – AbsTop(elmRibbon);

 

if(newWorkspaceHeight

 

 

Source – http://www.quercussolutions.com/blog/index.php/fixing-vertical-scrollbar-disabled-issue-in-sharepoint-2010/

Hide a custom webpart

Open the web-part in notepad….

Change

From true to false as below.

<IsVisible>false</IsVisible>

Show / hide fields on Edit Form

/Style%20Library/scripts/jquery-1.11.3.min.js

/Style%20Library/scripts/sputility.min.js

 

// wait for the window to load

$(document).ready(function () {

 

var fields = SPUtility.GetSPFields();

for (fieldName in fields) {

// do something with the field

if(fieldName == “Review On” || fieldName == “Approved By” || fieldName == “Approval Date” || fieldName == “Approved Version” || fieldName == “Current Version” )

{

SPUtility.GetSPField(fieldName).MakeReadOnly();

}

 

}

});

How do I filter a document library view to show the contents of a subfolder?

With SharePoint Designer you can edit the CAML of your XSLT List View.

If you set the Scope attribute of the View element to Recursive or RecursiveAll, which returns all Files and Folders, you can filter the documents by FileDirRef:

<Where>

<Contains>

<FieldRef Name=’FileDirRef’ />

<Value Type=’Lookup’>MyFolder</Value>

</Contains>

</Where>

This returns all documents which contain the string ‘MyFolder’ in their path.

Posted at : http://stackoverflow.com/questions/295448/sharepoint-how-do-i-filter-a-document-library-view-to-show-the-contents-of-a-su

How to create rich HTML email message in Sharepoint Designer 2010 workflow

1.
First create your HTML in any other HTML editing tool (NOTE: Try to avoid spacing & <br/>’s )

2. Then open your workflow in SPD 2010

3. Add “Send email” workflow action from ribbon

4. Keep “Send Email” action selected/highlighted

5. Then navigate to ribbon and select advanced properties

6. Select last option Body

7. Click on the button (3 dotted button) to open the text pad

8. paste your html

9. Click OK and open the action from workflow step

10. Then add your lookups and test it.

Done !

Moving database files to a different location

Step 1

ALTER DATABASE <databaseName> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE <databaseName> SET OFFLINE;

Step 2

ALTER DATABASE <databaseName> MODIFY FILE
(
Name = <logicalfilename>,
Filename = ‘<fullpathofthefile including.mdf>’
);

ALTER DATABASE WSS_Content_CCS MODIFY FILE
(
Name = <logicallogfilename>,
Filename = ‘<fullpathofthefile including.ldf>’
);

Step 3

Check permissions on the files in their new location,

i.e. SQL Server should have full control.

Step 4

ALTER DATABASE <databaseName>  SET ONLINE;

ALTER DATABASE <databaseName> SET MULTI_USER;

eg.

ALTER DATABASE StateServiceDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE StateServiceDatabase SET OFFLINE;

ALTER DATABASE StateServiceDatabase MODIFY FILE
(
Name = StateServiceDatabase,
Filename = ‘N:\SPTEST_StateServiceDB\StateServiceDatabase.mdf’
);

ALTER DATABASE StateServiceDatabase MODIFY FILE
(
Name = StateServiceDatabase_log,
Filename = ‘O:\SPTEST_StateServiceDB\StateServiceDatabase_log.LDF’
);

ALTER DATABASE StateServiceDatabase SET ONLINE;

ALTER DATABASE StateServiceDatabase SET MULTI_USER;