Wednesday, July 25, 2012

SharePoint Timer Job targeted at specific web application

I have a work around for this.

If any one knows the solution please update me @  rajesh.chennupati@gmail.com


basically features defined with some scope will appear in all the scope specific area

I means ( scope with web, will be visible in all site features
                scope with site, will be visible in all site collection features.......)

(we can avoid this by changing the feature's Hidden property to TRUE)


in the same way timerjobs' scope may be web application. So the same feature appears in all webapplications.

The problem is :- if feature's scope is webapplication/Farm then by default the feature is activated THOUGH YOU SELECT "NO ACTIVATION" in project properties.

It means the feature is activated when you deploy the sharepoint solution, ultimately the timerjob feature is activated and is called from all the webapplications in the farm.

This is not the required result.

So we have to deactivate the feature from the remaining webapplications apart from the required one.

If you have many web applications in your farm then it's tedious to deactivate.

The solution is:- Goto the feature where timerjob is registered with scope web application->  then goto properties (click F4 when you open the feature). Then set "Activate On Default" property to False.


This work around solved my problem.



powershell + The Feature is not a Farm level feature

I got the below error while deploying a feature using powershell.

Error:- The Feature is not a Farm level feature and is not found in a site level defined by the url ........


my powershell command is :- Enable-sPFeature -identity "XXX EventReceivers" -force -confirm:$false -url $WebURL

"XXX EventReceivers" is the feature name in my application.

But When I see in "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES" path the feature name is "ABC_XXX EventReceivers" . Where as "ABC" is my project name.


The working command is :- Enable-sPFeature -identity "ABC_XXX EventReceivers" -force -confirm:$false -url $WebURL

So dont overlook at the feature name.


Happy coding

Wednesday, July 11, 2012

SharePoint + SSRS Reports + Current User

How to pass current user's login name as parameter to a RDL . (SSRS integration with sharepoint)

Thanks to author @ 
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/751a3733-2e2b-49f8-8de5-8e692433091b/


 The important point hers is setting the "=User!UserID " value to parameter 

Goto parameters section and select the parameter which passes current user name as value,

right click on it, then select "parameter properties" .

Goto default valus tab, select "Specify values" Radio Button.

and in value field at bottom  paste

[&UserID]   OR   =User!UserID
   
It passes the value as "domain\firstName.LastName"

in sharepoint list, the people or group field shows by default as "Name (with presence) " 

change the type to "Account" for the field.

It should work fine



happy coding