Tuesday, June 28, 2011

Error Copying Reusable Workflows to other sites in Sharepoint 2010







Sharepoint 2010 has introduced new reusable workflows. When trying to copy and modify these resuable workflows, you may receive errors.



Use Sharepoint Designer 2010 to navigate to the subsite of your choice. Note: if you do not see any reusable workflows, you must create a blank one. This will create a location for you to be used for coping resuable workflows.






Solution: Expand "all file", locate workflows and copy your custom resuable workflow.






Lastly, select WorkFlows, then select your newly created reuseable workflow. In the "Forms" section, delete the forms. Next, save the workflow and select "Publish". This will recreate new forms and publish the workflow.

Thursday, June 16, 2011

How to set favicon for Sharepoint 2010

Create Gif or Jpg 16x16 pixels, 300 dpi

Convert Gif or Jpg to ICON file. You can use a free site to assist you. Example
http://www.prodraw.net/favicon/index.php

After you have successfully created and downloaded your Favicon.ico, unload the file to the style library images folder. (Site Actions/View all site Content/Style Library - Images folder)

From the Homepage, select site actions/edit in SharePoint Designer

Within SharePoint Designer you should see the root site. From "Site Objects", select "Master Pages"

Select and check-out v4.master. Note: you will see a green check next to v4.master

Click v4.master and select "Edit File" on the Customization section

Select "Find" from the ribbon and enter "SPShortcutIcon". This should position to the correct line to change
Note: if the following line is not found " , enter it before "

Lastly, change the path to the favicon.ico.
Example: "/Style%20library/images/favicon.ico"/> , enter it before "

Reset IIS

Friday, June 10, 2011

SharePoint - Server error: The URL is invalid, it may refer to a nonexistent file or folder or refer to a valid file that is not in the current Web

SharePoint throws the error "Server error: The URL is invalid, it may refer to a nonexistent file or folder or refer to a valid file that is not in the current Web" when you attempt to upload a file.

Explanation:

While there could be many reasons for this misleading error to show up, one of the reason is low disk space in the database server.

Solution:

Take a backup of the log file if required.
Truncate the log file

Remove any files no longer needed. Example: logfiles, old programs, old documents.


Clean up Script - SQL Server 2005

SET NOCOUNT ON

DECLARE @LogicalFileName sysname,

@MaxMinutes INT,

@NewSize INT


-- *** MAKE SURE TO CHANGE THE NEXT 4 LINES WITH YOUR CRITERIA. ***

USE [SharePoint_Config] -- This is the name of the database

-- for which the log will be shrunk.

SELECT @LogicalFileName = 'SharePoint_Config_log', -- Use sp_helpfile to

-- identify the logical file

-- name that you want to shrink.

@MaxMinutes = 10, -- Limit on time allowed to wrap log.

@NewSize = 10 -- in MB

-- Setup / initialize

DECLARE @OriginalSize int

SELECT @OriginalSize = size -- in 8K pages

FROM sysfiles

WHERE name = @LogicalFileName

SELECT 'Original Size of ' + db_name() + ' LOG is ' +

CONVERT(VARCHAR(30),@OriginalSize) + ' 8K pages or ' +

CONVERT(VARCHAR(30),(@OriginalSize*8/1024)) + 'MB'

FROM sysfiles

WHERE name = @LogicalFileName


CREATE TABLE DummyTrans

(DummyColumn char (8000) not null)


-- Wrap log and truncate it.

DECLARE @Counter INT,

@StartTime DATETIME,

@TruncLog VARCHAR(255)

SELECT @StartTime = GETDATE(),

@TruncLog = 'BACKUP LOG ['+ db_name() + '] WITH TRUNCATE_ONLY'

-- Try an initial shrink.

DBCC SHRINKFILE (@LogicalFileName, @NewSize)


EXEC (@TruncLog)


-- Wrap the log if necessary.

WHILE @MaxMinutes > DATEDIFF (mi, @StartTime, GETDATE()) -- time has not expired

AND @OriginalSize = (SELECT size FROM sysfiles WHERE name = @LogicalFileName) -- the log has not shrunk

AND (@OriginalSize * 8 /1024) > @NewSize -- The value passed in for new size is smaller than the current size.

BEGIN -- Outer loop.

SELECT @Counter = 0

WHILE ((@Counter < @OriginalSize / 16) AND (@Counter < 50000))

BEGIN -- update

INSERT DummyTrans VALUES ('Fill Log') -- Because it is a char field it inserts 8000 bytes.

DELETE DummyTrans

SELECT @Counter = @Counter + 1

END -- update

EXEC (@TruncLog) -- See if a trunc of the log shrinks it.

END -- outer loop

SELECT 'Final Size of ' + db_name() + ' LOG is ' +

CONVERT(VARCHAR(30),size) + ' 8K pages or ' +

CONVERT(VARCHAR(30),(size*8/1024)) + 'MB'

FROM sysfiles

WHERE name = @LogicalFileName

DROP TABLE DummyTrans

PRINT '*** Perform a full database backup ***'

SET NOCOUNT OFF