Wednesday, 19 November 2014

SideLoadinf feature is not enabled on the site in SharePoint online


Error: Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site.

I was trying to deploy a app in to SharePoint Online, then i got above error.

Solution: I have enabled Sideloading, then it resolved my problem.

Open: sharepoint online Management Shell

Copy below script and paste it sharepoint online Management Shell.

It will ask SPO Site url. Enter SPO url.
It will ask SPO Administrator User name and password. Enter user name and password.

You will see:
SideLoadinf feature enabled on the site.....

That's it. Now deploy your app in to SharePoint Online.

Sign in as Different User option missing in SharePoint 2013

Today i was trying to login to my SharePoint site using different user, but i couldn't find that option.
Then i came to know OOB SharePoint 2013 don't provide it.

Solution:
Follow below steps to get "Sign in as Different User" option

Go to SharePoint Server, open this path
C:\Program Files\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\CONTROLTEMPLATES\
Open Welcome.ascx

Search for ID = ID_RequestAcess




Paste above code above the tag ID = ID_RequestAcess

Tuesday, 18 November 2014

Not connected - No connections are available Windows 8


I am not able to see wifi icon
Solution:
Open C drive
You will find Network in the left side pane
Right click on Network, select properties
You will get new window
Click on "Change adapter settings"
You will get another window.
If You are able to see Wi-Fi and if it is Disabled.
Right click on Wi-Fi Click Enable
Now you will see wi fi icon in your task bar
Click on wi fi icon, it will show Wi Fi is On or Off
If Wi FI is Off, change to On
Now you will see abailable Wi Fi connections
Select any connection Click on Connect
If it is having pass word, enter password.
Check Connect automatically
Now you ready to access wi fi

SharePoint result source with OR condition

Using GUID
path:"https://spo" SPContentType=MyList owstaxIdColumnTerm:{03b7b387-506e-4620-99ff-2d1ee315581d} owstaxIdColumnType:{e5035750-1c98-4a72-8e12-0f1ccdb4244f} owstaxIdListPageElement:{720a2f5c-52f3-482e-a359-5861a48aac5c} isActiveOWSBOOL=1 -owstaxIdColumnRegion:{USA} OR owstaxIdColumnRegion:{QueryString.region}

Using Column text
path:https://spo SPContentType=MyList owstaxIdColumnTerm:MyTerm owstaxIdColumnType:MyType owstaxIdListPageElement:MyElement isActiveOWSBOOL=1 -owstaxIdColumnRegion:{USA} OR owstaxIdColumnRegion:{QueryString.region}

SharePoint Client Object Model JavaScript

Advantage of SharePoint Client Object Model for JavaScript
Web page can interact with SharePoint without requiring a page refresh. In the background, the page uses JavaScript to communicate with SharePoint via the COM to retrieve or update data in SharePoint.
Accessing SharePoint
The first thing to note about the COM with JavaScript is that it is disconnected from SharePoint in the sense that in order to retrieve or update data in SharePoint, asynchronous calls to the server must be made. Because of its asynchronous nature, the page can continue to be responsive to the user while the data is being retrieved or updated in the background. This can be both an asset and a liability if not handled properly.
In order to access the COM in a webpage, a reference to the JavaScript file containing the COM code must be included. There are 3 JavaScript files which contain the code for the COM: SP.js, SP.Core.js, and SP.Runtime.js. SharePoint provides the SharePoint:ScriptLink server control tag for referencing JavaScript files. Using the ScriptLink control will:
assure that the JavaScript file is loaded only once
assure that dependency files are also loaded
In a SharePoint Application page, the ScriptLink tag should be declared within the PlaceHolderAdditionalPageHead Content Placeholder.

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server" />
<SharePoint:ScriptLink Name="SP.js" LoadAfterUI="true" runat="server" />
</asp:Content>

Monday, 17 November 2014

Infosys PL/SQL Interview Questions

Tell me about your project
Can we load the data from table to table through utl_file package
Difference b/w sql *loader and utl_file package
Which is the faster way to load the data
Description about project?
What r the packages, functions, procedures you Developed in your project what are their Functionality?
Where u stored the files in db?
How u execute the code in sql prompt?
Tell me some names of functions and Procedures that u created in u r project?
What is the name of requirement Specification?

JSON JavaScript Object Notation

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
It is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.
Ex: Create JSON Object
var objJason = {
"EmpNo" : "1001",
"Name" : "JSON",
"Dept" : "IT"
};
Ex: Read JSON Object
document.write('EmpNo ' objJason.EmpNo); // Output: EmpNo 1001
document.write('Name ' objJason.Name); // Output: Name JSON

REST is Stateless service

Advantages of Stateless service
  • Better scaling
    1. No session storage on server
    2. Any server in a cluster can handle any request
    3. All the result pages can safely be cached
  • More reliable
    1.  client can safely re-send a request
  • Better resource reuse
    1. All the result pages can safely be linked to
  • By using REST over HTTP instead of SOAP, we can drastically reduce the overhead of message processing
  • An HTTP server implementation is feasible for a mobile device

Saturday, 15 November 2014

SharePoint 2013 New Features


1. My Documents — My "SkyDrive for Work"
The idea of storing personal documents in My Sites, rather than local drives, has always made sense to me: I can access my files from multiple devices as well as easily share files with teammates using links, rather than sending copies via email. Using a My Site for storing my documents also ensures that files are in a managed environment, rather than residing on intrinsically fallible local hard drives.
Despite these potential advantages, the My Site documents experience in SharePoint 2010 is clunky, overly reliant on constant availability and, more often that not, is not used.
The good news is that in SharePoint 2013 saving documents into My Sites is going to get a lot easier. In fact, it is the default location for saving documents from Office 2013. There is a single document library, not two as in SharePoint 2010, and the permissions have been simplified, making it a cinch to share documents with colleagues.
Better still, the My Site document library can be synced with a local drive to enable offline access so you can access your documents even when the server is unavailable. With this capability SharePoint 2013 My Documents can mount a strong case to be your "SkyDrive for Work."

2. App Store
In an interesting move that will at one stroke empower end users, reduce load on overworked IT operations departments and add fuel to the already active after-market for SharePoint add-ons, Microsoft is introducing an Apps Store model with SharePoint 2013.

3. Social Enterprise
Perhaps the most exciting changes in SharePoint 2013 relate to social capabilities. The list of new features is extensive: micro blogs, activity feeds, community sites, Following, Likes and Reputations are the standouts.
Of these I really like Following, which adds the ability to "follow" people, sites, documents and topics, with subsequent actions of the followed entity appearing in the user's activity stream. Keeping up to date with the activities of colleagues in SharePoint has never been easier.
As an aside, it is worth noting that the social tools market is white hot and feature advances are coming fast and furious. In this environment, Microsoft's three year product release cycle seems like an anachronism, leaving it constantly lagging behind its competitors.
The social features announced in this SharePoint 2013 preview — though representing the arrival of SharePoint a s a legitimate social platform contender — are nevertheless behind the state of the market today and this gap will only get wider by the time SharePoint 2013 is released to the market. This gap won’t matter to organizations that are committed to the SharePoint platform who will tolerate feature shortcomings in exchange for tight integration of "good enough" social capabilities into SharePoint.

4. Mobility
Clearly recognizing the massive rise in use of mobile smart devices, Microsoft has done some nice work to make it easier to access SharePoint content from a mobile device. Adding to the existing classic view, SharePoint 2013 offers two new views for mobile devices, including a contemporary view for optimized mobile browser experience and a full-screen view which enables the user to have a full desktop view of a SharePoint site on a smartphone device. These new views will be well received by smartphone users, as the existing experience, using mobile apps or the browser, is a little ordinary.

5. Site Permissions
A key selling point of SharePoint is the ability to have a distributed governance model, pushing the management of sites out to the business units. In practice though, the processes of granting or requesting access to a site in SharePoint 2010 are overly complex and a major source of confusion for site owners.
With SharePoint 2013 site owners are going to love the new, simplified sharing-based model for site permissions management. For IT help desk staff, used to spending a disproportionate amount of their time sorting out permission issues, this should come as a welcome relief.

6. Themes
The ability to have some control over the visual styling of a site is important to site owners. Everybody would like to have a site that looks great! SharePoint 2010 standard styling options are a little on the dull side. SharePoint 2013 will bring richer themes and even the ability to add a background image to the page.

7. Metro
Last, in this super 7 list is Metro, the Microsoft’s big user interface bet that’s easier to use, snazzy and well, different (in a good way)
its new, radical UI design, there is no doubt that the concept itself will be around for a while — Microsoft are planning to use Metro as the default UI for SharePoint as well as user tools like Office, Windows, Xbox and mobile devices.

Create custom view in sharepoint list

SharePoint stsadm backup restore export import

SharePoint site collection backup
--------------------------
1.On your SharePoint server hit WINDOWS + R.Type “cmd” and click OK.
2.In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
stsadm -o backup -url -filename [-nositelock] [-overwrite]
Ex:stsadm -o backup -url http://companyweb -filename d:\companyweb.bak -overwrite
3.Press Enter
4. file is there in d drive
How restore back site
1. Create a blank site in target sharepoint
2.On your SharePoint server hit WINDOWS + R.Type “cmd” and click OK.
3.In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
4 Type stsadm -o restore -url “http://companyweb” -filename “d:\companyweb.bak” -overwrite
5 Press Enter
Export
Stsadm –o export –url -filename .cmp
To back up an individual database, Web application, or the entire farm, you can use the following Stsadm command.
stsadm –o backup –directory -backupmethod
Restore
To import sites to your SharePoint Products and Technologies deployment, you use the following Stsadm command.
Stsadm –o import –url -filename .cmp
To restore a site collection, you must use the following Stsadm command.
stsadm –o restore –url -filename
To restore an entire farm you can use the following Stsadm command.
stsadm –o restore –directory -restoremethod

Not able to open MS Office files on SharePoint


Go to tools->
Internet options-->
Advanced -->
select "Always Send URLs as UTF-8"

Wipro PL/SQL Interview Questions

Tell me about your project
|What are the path names u provided to Execute u r coded data?
Steps to get the data from oracle to unix Environment?
Difference between having and group by
Difference between case and decode
Difference between delete and truncate
How many types of indexes
What is trigger and types
Diff b/w view and materialized view
Can we update the view
I have one table i created view and materialized view on a table if i delete a table
Can i see the view and materialized view?
Can u call function in same function
Can we use tcl commands in trigger
What is the cursor and ref cursor

Thursday, 13 November 2014

C# Remove duplicates

Error occurred while configuring Search Foundation

How to open Environment variables
Open Control Panel
Search for: Environment variables
Click Edit the system Environment variables
Click on Advanced Tab
Click Environment Variables..
Click on PSModulePath
Variable Name: PSModulePath
PSModulePath should not have leading and ending white space
Variable value: valye should not have leading and ending white space

SharePoint error the context has expired and cannot be used


Solution:
Set the application pool to recycle once in 24 hours
Configure an Application Pool to Recycle at a Scheduled Time 
Steps:
Open IIS Manager
In the Connections pane, expand the server node and click Application Pools
On the Application Pools page, select an application pool, and then click Recycling in the Actions pane.
Select Specific time(s), and in the corresponding box type a time at which you want the application pool to recycle daily.For example, type 11:30 AM or 11:30 PM.
Note: The value that you enter is saved in configuration based on a 24-hour clock.
Click Next, select the events that should be logged when an application pool recycles and then click Finish.

How to find FAST server names


Ans:
Open  deployment.xml file.
C:\FASTSearch\deployment.xml 
<FASTSearchFolder>\etc\, where <FASTSearchFolder> is the path of the folder where you have installed FAST Search Server 2010 for SharePoint, for example C:\FASTSearch.
Example of deployment.xml
You can find server names from above file

Could not load the current My Site Settings SharePoint error

Solution:
I have provided the farm account full permissions on the Search Service Application, then it has resolved.

Contact your administrator for more information error SharePoint Server 2013 site

I was trying to log in my SharePoint site, i was getting above error.
Solution:
I have cleared the cookies from my Internet Explorer. Then problem solved.
How to delete cookies from Internet Explorer
Open Internet explorer.
Click on Internet Options.
You get a window.
Under General.
Click on Delete.
Select the Cookies and website data check box, and then click Delete .

Update SharePoint List Item using CSOM

Wednesday, 12 November 2014

VSTF How to find build number

Open Visual Studio
Connect VSTF
Click on Builds
Actions
View My Builds
Un check: Only show builds requested by me
Now find which build number you want.
Click on that item.
Check for: SourceBuildNumber

Microsoft Test Manager integration with tfs

Assuming you have written all automation test cases using C# or Vb.Net and successfully build the code.
Provided your MTM is configured environment.

Open MTM.
Click Plan.
Create New Suite.
Click on Your Suite.
Add existing test cases to your suite.
Click Add @right side.
Write your Query to get all your test cases.
Select all TCs.
Click Add test cases.
Open each test case and click on Associated Automation (last tab).
If you are seeing blank at: Automated test name, the do bellow steps.
Open test case from VSTF:You will find "associated automation". Click on ...Search for your automation test case method and select it. Save
Save
Go to TEST mode in MTM
Set build:
Click on Build in the top right side of MTM.
Click on Modify @  Filter for builds. Change build name...
Click on Modify @ Build in use.
Select right build... Save
Click on your test suite.
Select all your test cases.
Rigt click select run with option.
Select your build, where your test case code is there
Build Config: select release
Test settings: Select browser
Environment:
Click Run

SharePoint Content Search Web Part (CSWP)


Content Search Web Part (CSWP):  This is new web part in SharePoint 2013 and SPO. It will take a query and get the results based on query.
We can create a result source (Result source: where we can write query) and select that in CSWP.

We can apply custom Item and Control template to render the data.

Normally all search output pages will expect some input, but in CSWP we can get the result with out input. Mean if you want to show List Items in a page, we can use CSWP with query as select My list items.
So CSWP will get all list items, with out writing any code..we can all filtering for query.

We can use custom display templates (Item/ control template) to show custom rendering.

How to add a Content Search Web Part to a page:

Go to SharePoint site, open any page. Click Edit page.
In the Web Part Zone where you want to add the Web Part, click Add a Web Part.
In the Categories list, click Content Rollup.
In the Parts list, click Content Search, and then click Add.
The CSWP contains a default query, so it already displays some content.
Note: To get our content, we'll need to configure the query in the Web Part.

How to configure a query in a Content Search Web Part on a category page

In the Web Part, click the Web Part Menu , and then click Edit Web Part.
In the Web Part tool pane, click Change query. This will open a dialog box.
Now you can play and try with different query to get your data.

If you want to change the display templates.
Under "Display Templates"
Change "Control" and "Item" dropdowns..You will see some out of box templates...
You can add custom templates also..

Carousel image and Message using jQuery and bootstrap

Download bootstrap css and js files and jquery file.

How to find Solution files in SharePoint

Open Wen Site.
Site Actions
Site Settings
Galleries
Click on "Solutions"
You can find Deployed solution in that Web site.

Infopath date time - today() vs now()

Difference between today() vs now()
today() and now() can both be used to set the default value of a date picker. However, the type of form you have can affect which one you use.
- Use today() when you have a date-only field.
- Use now() when your field requires a date and time.
In general, when using a SharePoint list form, use now(). When using a form library or filler-only form, use today(), unless you have changed the data format of the date field to date and time.

K2 BlackPearl Read Process Data From XML

Polaris Sharepoint Interview

• What is Office 365 , SharePoint online?
• How does  SharePoint online actually work?
• What is the use of SQL server in SharePoint & use of Virtual path provider?
• What is Ghosting and UnGhosting in SharePoint?
• How can we create a site in SharePoint online?
• How can we Customize a SharePoint Site?
• What kind of ready made functional modules exists collaboration?
• Can you display a simple Custom Page in SharePoint?
• How can we implement behind code ASPX pages in SharePoint?
• What is the concept of features in SharePoint?
• I want a feature to be only displayed to admin?
• How do we debug SharePoint error’s?
• Why customized pages are parsed using no-compile mode?
• Can you explain SPO model?
• How can we use custom controls in SharePoint?
• How can we display ASCX control in SharePoint pages?
• What is WebPart and App Part?
• How can we achieve customization and personalization using App Part?

Tuesday, 11 November 2014

What is the difference between method activity and event activity in Workflow

A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

TCS informatica Interview

What are the scheduling options to run a session
Can you start a batches with in a batch?
Can you start a session inside a batch individually?
what is inline view?
checkout and check in in informatica 8.6
how did u understand business requirement?
How do you configure mapping in informatica?
How to Join Tables my Source is having 15 table target is one?
How many types of dimensions are available in Informatica?
What is the difference between stop and abort?
How can you recognize whether or not the newly added rows in the source are gets insert in the target?
What is the difference between Informatica 7.0 and 8.0 ?
Performance tuning in Informatica?

"New" ribbon icon disabled in SharePoint central admin

Solution:
Start-->All Programs-->Select IE--> Right Click on IE-->Select Run as Administrator

How to show infoptah form new item request in the home page.

Open SP2013 home page
Click Edit the page
Add webpart
Select Infopath form webpart from form category
Add
Configure the webpart
Select the Source list
Ok.
Now you will see infopath form in the home page.

SharePoint Site Backup and Restore

Backup the site using the following STSADM Command:
Stsadm –o backup –url http://: -filename

Example:
Stsadm –o backup –url http://vanillargk:5555 –filename "e:\backup5555.bak"
Create a new Web Application for restoring the site:
Go to Central Administration -> Application Management -> under SharePoint Web Application Management -> click Create or Extend Web Application. Fill in the required information, click Ok and wait until the progress continues.
Once the new web application is created, run the following STSADM command and restore the site using the backup file created above.
Stsadm –o restore –url http://: -filename
Stsadm –o restore –url http://vanillargk:6666 –filename "e:\backup5555.bak"
Restored site should be up and running.
If it is not (and you are receiving weird errors in your browser), keep reading:
Now it could be the case that you have customized your site. So, we must deploy those customizations properly for the site to work as expected. This is typically a scenario while moving your site from Testing to Production environment. First you have to add the solutions (if any created) to the farm.
Add a Solution to the SharePoint Farm:
Add the solution package to the farm by running the following commands. Make sure full path of WSP file is supplied.
stsadm –o addsolution –filename
Deploy the Solution to the restored site:
stsadm -o deploysolution -name mysolution.internet.test.wsp -url -immediate -allowgacdeployment –allowcaspolicies
Make sure all your assemblies (DLLs) are available in Global Assembly Cache (GAC) usually placed at c:\windows\assembly.
Activate features installed by mysolution.internet.test.wsp solution package:


Backup and restore will not work for sub sites.
Import and export will not work for workflows. It will work for sub sites and site collection also.

Get User Email from Active Directory

SharePoint Client Object Model Javascript : JSOM to retrieve an item based on its ID

var item;
Function getItemById(itemId)
{
var clientContext = new SP.ClientContext.get_current();
var web = clientContext.get_web();
var list = web.get_lists().getByTitle('mycustomList');
This.item = list.getItemById(itemId);
clientContext.load(item);
clientContext.executeQueryASync(Function.createDelegate(this, this.onSuccess), Function.createDelegate(this, this.onFailure);
}
Function onSuccess()
{
Alert('Success');
}
Function onFailure()
{
Alert('Failure!');
}

Can i make my web front end server as a Crawl server in Sharepoint

Can i make my web front end server as Crawl server.
Ans) It's not suggestable.
Reason:
The reason for a crawl target is to limit the user impact of the Search Crawl on your Production farm. Crawling will hammer your Front End servers due to massive amount of requests for content. If you set up a crawl target (dedicate a box directly for search crawls) then users will be not impacted by your heavy performance crawl in-progress
How to stop Crawl in WFE.
Disable HTTP throttling on the crawl target so no crawl requests will be queued or delayed on the Front End machine. Open up a SharePoint Management Console (PowerShell) and run this script
$svc=[Microsoft.SharePoint.Administration.SPWebServiceInstance]::LocalContent
$svc.DisableLocalHttpThrottling
$svc.DisableLocalHttpThrottling=$true
$svc.Update()
How to setup a dedicated Crawl Server.
To set the farm to distribute crawl traffic to only the Front End that is specified as your crawl target, in this example : Server1 is my crawl target and http://sharepoint is my farm name. Run this in the same or seperate instance of PowerShell.
$env:farmurl = "http://sharepoint"
$env:crawltarget = "server1"
$listOfUri = new-object System.Collections.Generic.List[System.Uri](1)
$zoneUrl = [Microsoft.SharePoint.Administration.SPUrlZone]'Default'
$webappUrl = $env:farmurl
$webapp = Get-SPWebApplication -Identity $webappUrl
$webApp.SiteDataServers.Remove($zoneUrl)
$listOfUri.Add("http://$env:crawltarget");
$webApp.SiteDataServers.Add($zoneUrl, $listOfUri);
$WebApp.Update()
You have successfully setup your crawl target, now your Search crawls can perform with high performance without impacting users on your farm.

SharePoint Add Query Rules for promoted results

Create a result source. Ex: MySearchResult
Add Query Rules for promoted results
Open SPO site. The site where your search page is configured.
Click on Site Settings
Click on Query Rules

Click on “Select Result Source…”

Select: MySearchResult
Click on “New Query Rule “


In the new window, Enter Rule name.
Click on “Add Promoted Result

You will see new window. Add some data.

Repeat Click on “Add Promoted Result” and add some data.

After adding promoted results, page will looks like this.


Why we need to create Named Query in SSAS instead of using Normal View


In Actual Development, You will not have any permission in Database (Client Database), so you can not create View in Database.
So we can do only using Named query from Data Source Views and named query will not be available in Actual Database. It will be available in Data Source Views level

How to restart IIS


Click Start.
Click Run
Type IISReset
ok
Or
Open IIS.
How to open IIS
Click Start.
Click Run
Type inetmgr
In IIS Manager, right click the local computer, point to All Tasks, then click Restart IIS.
Or
1. From the Start menu, click Run.
2. In the Open box, type cmd, and click OK.
3. At the command prompt, type iisreset /stop. IIS will attempt to stop all services and will return confirmation once all services have been stopped.
4. At the command prompt, type iisreset /start.

How to hide Web Part Headers in SharePoint

1. Add a content editor web part to your page.
2. Edit the Web Part
3. Click in the content area of the web part, click HTML and select “Edit HTML Source”
4. Put the following code in the web part:
Add below code in the style tag
TR.ms-viewheadertr > TH.ms-vh2 {
DISPLAY: none
}

5. Click “OK”
6. Expand “Appearance” (on the right side of the page)
7. Set the chrome type to “None”
8. Click “OK” and then save and check in your page.
The headers of your web part should now be hidden. This can be extremely helpful when your page contains a web part using “boxed” for your style when creating a list view. The only downside to this approach is if you have multiple web parts on a single page, it will hide the headers for all the web parts on your site.
Hide Web Part Headers with SharePointHide Web Part Headers with SharePointHide Web Part Headers with SharePointHide Web Part Headers with SharePointHide Web Part Headers with SharePointHide Web Part Headers with SharePoint

Monday, 10 November 2014

What is Site and Site Collection in SharePoint

What is Site
Site is a collection of web pages which is used to store information in organized way.
Site stores list of documents, discussion, events, task and many other types of information.
Site provides controlled access to share information among user. i.e. Only Authorize users are allowed to access shared information.
What is Site Collection
Site Collection is collection of SharePoint site. i.e. SharePoint site collection is logical grouping of multiple SharePoint site.

Microsoft Windows

\\SystemName\ c$ To access C drive
\\SystemName\ d$ To access D drive
\\SystemName\ e$ To access E drive
==========================================
Services
--------
MOSS 2007
Windows SharePoint Services Administration
Windows SharePoint Services Search
Windows SharePoint Services VSS Writer
SQL
SQL Server Browser
SQL Server (MSSQLSERVER)
==========================================
ildasm.exe
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
machine.config
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
aspnet_regsql.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
==========================================
Sharepoint Log
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS
====================================================================================
MSTSC
Login as Admin and Kill other user accounts
mstsc -v:SERVER /f -admin
====================================================================================
Managing event logs from the command line
Run-->eventvwr.exe
or
Start-->control panel-->Administrative Tools-->Event Viewer
====================================================================================
Service
Run-->services.msc
Or
Start-->control panel-->Administrative Tools-->Services

Add user custom action to Site Actions menu using Client Object Model


C# Get Set Properties

Sharepoint Custom Workflow

// Method used to get the SharePoint List that the workflow is attached to and the list item that we are working on
private void getTaskListInformation()
{
// Get the Task List that we are attached to, by converting the Guid Parameter into a Guid
this._TaskListAttachedTo = this._myTeamSite.Lists[new Guid(this._paramSPListGuid)];
// Get the Task Item Object that the workflow has created
this._TaskListItem = this._TaskListAttachedTo.GetItemById(System.Convert.ToInt16(this._paramTaskListItemID));
string[] passedLink = _TaskListItem["Link"].ToString().Split(',');
listID = Convert.ToInt32(passedLink[0].Split('=')[1]); // Get the application request ID.
// Get the ID of the Workflow Instance that we are running with in
this._workflowInstanceGuid = new Guid(Convert.ToString(this._TaskListItem["WorkflowInstanceID"]));
// Instantiate the workflow
this._activeWorkflow = new SPWorkflow(this._TaskListItem, this._workflowInstanceGuid);
}
=============================
private void getTaskListInformationByListItem()
{
listID = Convert.ToInt32(Request.Params["ID"]);
SPSite site = SPContext.Current.Site;
using (SPWeb web = site.OpenWeb())
{
SPList JobRequest = this._myTeamSite.Lists["Request"];
SPListItem JobRequestItem = null;
if (listID > 0)
{
JobRequestItem = JobRequest.GetItemById(listID);
}
if (JobRequestItem != null)
{
SPListItemCollection taskListItems = JobRequestItem.Workflows[0].TaskList.Items;
foreach (SPListItem item in taskListItems)
{
string[] passedLink = item["Link"].ToString().Split(',');
if (Convert.ToString(item["Status"]) == "Not Started") // Get the Application request ID.
{
// Get the Task List that we are attached to, by converting the Guid Parameter into a Guid
this._TaskListAttachedTo = this._myTeamSite.Lists["Tasks"];
// Get the Task Item Object that the workflow has created
this._TaskListItem = this._TaskListAttachedTo.GetItemById(item.ID);
// Get the ID of the Workflow Instance that we are running with in
this._workflowInstanceGuid = new Guid(Convert.ToString(this._TaskListItem["WorkflowInstanceID"]));
// Instantiate the workflow
this._activeWorkflow = new SPWorkflow(this._TaskListItem, this._workflowInstanceGuid);
}
}
}
}
}
==================================================================
// Code that responds to the Reject Button Click event.
protected void btnReject_Click(object sender, EventArgs e)
{
if (isValid())
{
Hashtable taskHash = new Hashtable(); // Task data is sent via a Hash Table
taskHash["_ApporvalStatus"] = false;
taskHash["Status"] = "Complete";
taskHash["PercentComplete"] = "0";
taskHash["Action"] = "Rejected";
SPSite site = SPContext.Current.Site;
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWorkflowTask.AlterTask(this._TaskListItem, taskHash, true); // Send the data to the task list, by altering the tasks value
});
web.AllowUnsafeUpdates = false;
}
string strRequestorRole = this._TaskListItem.Title;
UpdateAuditTrail("Rejected", strRequestorRole.Replace(" Task", ""));
SPUtility.Redirect(this._TaskListAttachedTo.DefaultViewUrl, // Redirect the UI back to the Task List. You could chose
SPRedirectFlags.UseSource,
HttpContext.Current);
}
}
==============================================================================
// Code that responds to the Cancel Button Click event.
protected void btnCancel_Click(object sender, EventArgs e)
{
// If the user cancels out on the Workflow Task Edit Form, we'll take them back to the Document Library
if (this._TaskListAttachedTo == null)
{
SPUtility.Redirect(this._myTeamSite.Url,
SPRedirectFlags.UseSource,
HttpContext.Current);
}
else
{
SPUtility.Redirect(this._TaskListAttachedTo.DefaultViewUrl,
SPRedirectFlags.UseSource,
HttpContext.Current);
}
}
=========================================================================
// Code that responds to the Accept Button Click event.
protected void btnAccept_Click(object sender, EventArgs e)
{
SPSite site = SPContext.Current.Site;
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
int statusID = GetLookupId("Accepted", "Title", "JobRequestStatus");
SPList JobRequestListItems = web.Lists["Request"];
SPListItem requestItem = JobRequestListItems.GetItemById(listID);
requestItem["Status"] = new SPFieldLookupValue(statusID, "Accepted");
requestItem["Scheduler"] = Request.ServerVariables["LOGON_USER"].ToString();
requestItem.Update();
web.AllowUnsafeUpdates = false;
}
// If the user cancels out on the Workflow Task Edit Form, we'll take them back to the Document Library
SPUtility.Redirect(this._TaskListAttachedTo.DefaultViewUrl,
SPRedirectFlags.UseSource,
HttpContext.Current);
}

issue while installation K2 Blackpearl

If you are getting any issue while installation if you get any issue please check whether below things are installed or not.
SharePoint Server 2007 SP2 64bit (one server - Windows Server 2003 R2 SP2 64bit)
SQL Server 2005 SP2 32bit (one server - Windows Server 2003 SP2 32bit)
1.All necessary additional software and windows components are installed
Ex: com+, MSMQ, MS Redist, DTC installed and configured
2.Kerberos is activated for the SharePoint Portal Web Application
3.DNS entries, host header and SPNs are set correctly (no duplicate entries)
4.Permissions for k2 service accounts are set correctly (farm admin, site collection admin, sql admin)

Coding Standards

Namespaces:
Remove the unused namespaces and separate the Asp.Net framework namespaces with third party or other frame work spaces as below.
This makes the identification of namespaces at first look itself.
Always use Response. Redirect with false as its second parameter value
Response.Redirect("Response.aspx?ErrorID=1000",false);
Conditions Format
if (!(Session["FullName"] == null))
Use the below format for better readability
if (Session["FullName"] != null)
String Conversion not required on control’s text values
if (!string.IsNullOrEmpty(txtComment.Text.ToString().Trim()))
{
}
txtComment.Text itslef will return the string value and again don’t need to convert that value using ToString() method this looks odd, pleease remove this.
Use Page.IsValid property under submit/resubmit event handlers
if (Page.IsValid)
{
//Show some message to the user saying the validations are not met on page/ show validation summary control
return;
}
This helps avoiding the unexpected behavior of pages when validations are not firing because of JavaScript errors.
Add sub functions for main functions
If possible try to reduce the no’ of lines of code for each function by diving the functionality into sub functions (common logic).
Exception rising
catch (Exception ex)
{
//objCommonMethods.GenericExceptionMethod(ex);
spnErrorMsg.Visible = true;
objCommonMethods.DisplayMessage(this.spnErrorMsg, "Error", "Error Occured While Page Loading.");
}
Here we are not sowing the actual exception; this will not help in trouble shooting the issues in production. So please add the inner exception message to the display message.
catch (Exception ex)
{
//objCommonMethods.GenericExceptionMethod(ex);
spnErrorMsg.Visible = true;
objCommonMethods.DisplayMessage(this.spnErrorMsg, "Error", "Error Occured While Page Loading." + ”
” ex.Message +”
” + ex.StackTrace);
}
ex.StackTrace will give us the line number of code which is throwing the exception.
When throwing exception use the below format:
catch (Exception ex)
{
// throw ex;
throw new Exception("Exception in GetApprovers method", ex);
}
Use StringBuilder over strings when string concatenation is required more than 2 levels:
Use length condition before using string remove methods ***
Remove web related and unused namespaces in class files.
For string comparison use string.Compare()
With comparison method:
if (string.Compare(CompairFile.Trim(),InFile.Trim(),false) == 0)
{
file.Delete();
break;
}
Remove the commented code in all the files
Use count condition check before using a list enumeration in foreach loop
Ex:
foreach (DataRow drRole in dsApprovers.Tables[0].Rows)
{}
If the dsApprovers.Tables[0] doesn’t have any rows, it throws an exception.
Please check the for the same in other places.
Use DataTables over Datasets
For functions we are using Dataset in many places, but I think it will make sense when we use Data Table directly. Usually we use Dataset when we fill multi table’s data with relation. In our case we are nowhere storing multiple tables into Dataset. So using Data Tables is suggestible.
Move all the connection strings and constant values those are coming form web.config file can be moved to CommonConstantVariables class and can be made them static properties
Make Page level viewstate and session false for static pages like Response.aspx, confirmation.aspx and Unauthorized.aspx. This helps the pages load faster.
Example:

SharePoint Apply Branding using Feature


Apply Branding using Feature

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
Add a class
public class ApplyBranding : SPFeatureReceiver
{
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb web = (SPWeb)properties.Feature.Parent;
using (SPSite site = new SPSite(web.Url))
{
using (SPWeb rootWeb = site.RootWeb)
{
string serverRelativeUrl = rootWeb.ServerRelativeUrl;
string masterUrl = getPropertyFrom(properties, "MasterUrl");
string customMasterUrl = getPropertyFrom(properties, "CustomMasterUrl");
string alternateCssUrl = getPropertyFrom(properties, "AlternateCssUrl");
string siteLogoUrl = getPropertyFrom(properties, "SiteLogoUrl");
string theme = getPropertyFrom(properties, "Theme");
bool isMySite = getPropertyFrom(properties, "IsMySite").Equals("TRUE", StringComparison.InvariantCultureIgnoreCase);
if (serverRelativeUrl != "/" && !isMySite)
{
masterUrl = mergeUrls(serverRelativeUrl, masterUrl);
customMasterUrl = mergeUrls(serverRelativeUrl, customMasterUrl);
alternateCssUrl = mergeUrls(serverRelativeUrl, alternateCssUrl);
}
saveOldBranding(web);
applyBranding(web, masterUrl, customMasterUrl, alternateCssUrl, siteLogoUrl, theme, isMySite);
}
}
}
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPWeb web = (SPWeb)properties.Feature.Parent;
bool isMySite = getPropertyFrom(properties, "IsMySite").Equals("TRUE", StringComparison.InvariantCultureIgnoreCase);
if (!isMySite)
{
resetBranding(web);
}
else
{
string masterUrl = "default.master";
string customMasterUrl = "default.master";
string alternateCssUrl = "";
string siteLogoUrl = "";
string theme = "";
web.Properties.Update();
applyBranding(web, masterUrl, customMasterUrl, alternateCssUrl, siteLogoUrl, theme, isMySite);
}
}
public override void FeatureInstalled(SPFeatureReceiverProperties properties)
{ }
public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
{
SPWeb web = (SPWeb)properties.Feature.Parent;
string masterUrl = removeFromwebProperties(web, "BrightstarrBrandingMasterPageUrl");
string customMasterUrl = removeFromwebProperties(web, "BrightstarrBrandingCustomMasterUrl");
string alternateCssUrl = removeFromwebProperties(web, "BrightstarrBrandingAlternateCssUrl");
string siteLogoUrl = removeFromwebProperties(web, "BrightstarrBrandingSiteLogoUrl");
string theme = removeFromwebProperties(web, "BrightstarrBrandingTheme");
web.Properties.Update();
web.Update();
}
private string getPropertyFrom(SPFeatureReceiverProperties properties, string key)
{
string propertyValue = string.Empty;
try
{
propertyValue = properties.Feature.Definition.Properties[key].Value;
}
catch
{ }
return propertyValue;
}
private void saveOldBranding(SPWeb web)
{
saveToWebProperties(web, "BrightstarrBrandingMasterPageUrl", web.MasterUrl);
saveToWebProperties(web, "BrightstarrBrandingCustomMasterUrl", web.CustomMasterUrl);
saveToWebProperties(web, "BrightstarrBrandingAlternateCssUrl", web.AlternateCssUrl);
saveToWebProperties(web, "BrightstarrBrandingSiteLogoUrl", web.SiteLogoUrl);
saveToWebProperties(web, "BrightstarrBrandingTheme", web.Theme);
web.Properties.Update();
}
private void saveToWebProperties(SPWeb web, string key, string value)
{
saveToWebProperties(web, key, value, false);
}
private void saveToWebProperties(SPWeb web, string key, string value, bool update)
{
if (!web.Properties.ContainsKey(key))
web.Properties.Add(key, value);
if (update)
web.Properties.Update();
}
private void applyBranding(SPWeb web, string masterPageUrl, string customMasterUrl, string alternateCssUrl, string siteLogoUrl, string theme)
{
applyBranding(web, masterPageUrl, customMasterUrl, alternateCssUrl, siteLogoUrl, theme, false);
}
private void
applyBranding(SPWeb web, string masterPageUrl, string customMasterUrl, string alternateCssUrl, string siteLogoUrl, string theme, bool isMySite)
{
if (!string.IsNullOrEmpty(masterPageUrl))
{
if (isMySite)
{
if (web.MasterUrl.Contains("default.master"))
{
web.MasterUrl = web.MasterUrl.Replace("default.master", masterPageUrl);
}
else
{
web.MasterUrl = web.MasterUrl.Replace(masterPageUrl, "default.master");
}
}
else
web.MasterUrl = masterPageUrl;
}
if (!string.IsNullOrEmpty(customMasterUrl))
{
if (isMySite)
{
if (web.CustomMasterUrl.Contains("default.master"))
{
web.CustomMasterUrl = web.CustomMasterUrl.Replace("default.master", customMasterUrl);
}
else
{
web.CustomMasterUrl = web.CustomMasterUrl.Replace(customMasterUrl, "default.master");
}
}
else
web.CustomMasterUrl = customMasterUrl;
}
web.AlternateCssUrl = alternateCssUrl;
web.SiteLogoUrl = siteLogoUrl;
web.ApplyTheme(theme);
web.Update();
}
private void resetBranding(SPWeb web)
{
string masterUrl = fetchFromwebProperties(web, "BrightstarrBrandingMasterPageUrl");
string customMasterUrl = fetchFromwebProperties(web, "BrightstarrBrandingCustomMasterUrl");
string alternateCssUrl = fetchFromwebProperties(web, "BrightstarrBrandingAlternateCssUrl");
string siteLogoUrl = fetchFromwebProperties(web, "BrightstarrBrandingSiteLogoUrl");
string theme = fetchFromwebProperties(web, "BrightstarrBrandingTheme");
applyBranding(web, masterUrl, customMasterUrl, alternateCssUrl, siteLogoUrl, theme);
}
private string removeFromwebProperties(SPWeb web, string key)
{
return removeFromwebProperties(web, key, false);
}
private string removeFromwebProperties(SPWeb web, string key, bool update)
{
string returnValue = string.Empty;
if (web.Properties.ContainsKey(key))
{
returnValue = web.Properties[key];
web.Properties.Remove(key);
}
if (update)
web.Update();
return returnValue;
}
private string fetchFromwebProperties(SPWeb web, string key)
{
string returnValue = string.Empty;
if (web.Properties.ContainsKey(key))
{
returnValue = web.Properties[key];
}
return returnValue;
}
private string mergeUrls(string serverUrl, string relativeUrl)
{
string returnUrl = serverUrl;
if (!serverUrl.EndsWith("/"))
returnUrl = serverUrl + "/";
if (relativeUrl.Length > 1)
{
if (relativeUrl.StartsWith("/"))
relativeUrl = relativeUrl.Substring(1);
returnUrl = returnUrl + relativeUrl;
}
return returnUrl;
}
}

Friday, 7 November 2014

How to get browser name using javascript

What is the difference between NameSpace and Assembly

√ Assembly is physical grouping of logical units. Namespace logically groups classes.
√ Namespace can span multiple assembly.

How to recall email from outlook


Go to the Sent Items folder in Outlook and open the message you want to recall.
Tools menu-->Click on Recall This Message
If your message hasn't already been opened by the recipient, either delete the message or replace it with a new message.
if there are multiple recipients, you can request notification of whether the recall succeeded or failed for each one (at least you'll know whom to apologize to). Even if you successfully recall a message, the recipient may still know that you sent a message and then recalled it. So if you didn't replace it with a corrected message, you'll need to get your story straight as to why you recalled it.

SharePoint 2013 WCF and REST Url


Get Web Details
https://microsoft.sharepoint.com/teams/MySite/Test/_vti_bin/client.svc/web
Get All List information
https://microsoft.sharepoint.com/teams/MySite/Test/_vti_bin/client.svc/web/Lists
Get List Titles using
https://microsoft.sharepoint.com/teams/MySite/Test/_vti_bin/client.svc/web/Lists?$Select=Title
Or
We can use below one.
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists?$Select=Title
Get List
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('Documents')
When you open above link, you can see below tag.
<id>https://microsoft.sharepoint.com/teams/MySite/Test/_api/Web/Lists(guid'103d796b-25cf-4c85-bfbd-ab533b94ee08')</id>
https://microsoft.sharepoint.com/teams/MySite/Test/_api/Web/Lists(guid'103d796b-25cf-4c85-bfbd-ab533b94ee08')
We can open list using Guid. What it will do it internall it will call server side API to get the list using Guid.

_api is alias for _vti_bin/client.svc
We can replace _vti_bin/client.svc with _api

Get list items
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('Documents')/items
Get Only some columns
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('Documents')/items?$select=Title
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('Documents')/items?$select=Title,Modified
For my custom list
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('MyList')/items?$select=Title,Group
Get Specific Item
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('MyList')/items(2)
Filter on title, which starts with T
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('MyList')/items?$filter=startswith(Title,'T')
More than one query string
https://microsoft.sharepoint.com/teams/MySite/Test/_api/web/Lists/GetByTitle('MyList')/items?$select=Title,Group&$filter=startswith(Title,'Test2')
Based on Column: REST API
List item id:
url: http://site url/_api/web/lists/GetByTitle(‘Test')/items(item id)
filter based on column
/_vti_bin/ListData.svc/ListName?$filter=COLUMN1 eq 'VALUE11’


Get all List Columns:
https://SP2010/XXXX/_api/web/Lists/GetByTitle('MyListName')/items

Sharepoint change Maximum Upload Size

Open SharePoint 2010
Go to Central Administration -->Application Management -->Manage web applications
Select web application which you are tring to change upload size.
Once you select web application it will hilight, in the top you can find...
Web Application-->general Settings
click down arrow under general Settings
select general Settings.
scroll down you can find "Maximum Upload Size"
Here you can increase the size.
In the same page you can change Security validation expires, tile also
Max no of Alert are default :500
you can change this no.
Default Quota Template.
If it is no noquota, you can data with out limit
if it is personal site: 100 Mb limit

SharePoint 2010 Customizing the Access Denied Message (AccessDenied.aspx)


Open below Page, and add the and add Custom Text under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\AccessDenied.aspx

SharePoint Search result Refinement count using search API

Using below api we can get search result refinement count.

I am search for Bill Gates, and file type is based on my requirement...
You can find below...

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("pptx")'

<d:RefinementCount m:type="Edm.Int64">43373</d:RefinementCount>

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("docx")'

<d:RefinementCount m:type="Edm.Int64">32977</d:RefinementCount>

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("msg")'

<d:RefinementCount m:type="Edm.Int64">14322</d:RefinementCount>

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("pdf")'

<d:RefinementCount m:type="Edm.Int64">6602</d:RefinementCount>

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("html")'

<d:RefinementCount m:type="Edm.Int64">19587</d:RefinementCount>

https://SPO/search/_api/search/query?querytext='Bill Gates'&refiners='filetype'&refinementfilters='filetype:equals("zip")'

<d:RefinementCount m:type="Edm.Int64">2219</d:RefinementCount>

Thursday, 6 November 2014

Find GUID of a SharePoint List

Open Any SharePoint List
Click on List Settings
Under “Views”
Click on any view
Scroll down, you can find “Mobile” section
Here we cann find List GUID and View Guid
_layouts/mobile/view.aspx?List=

Tuesday, 4 November 2014

Difference between Features, Feature Definition and Solutions

Using Features and Solutions will help customize sites and site templates.
Features: It helps sites to reuse functionality from one site to other sites without requiring to copy and paste XML. It is also an instance of Feature Definition.
Solutions: It helps to package Features in a cabinet (.cab) file along with meta data.
Feature Definition: It hides feature manifest contained in a feature directory and are installed at farm level.

jQuery toggle on Button Click

Monday, 3 November 2014

5007: Unable to get property 'TaxonomyField' of undefined or null reference


Solution:
Add <script type="text/javascript" src="_layouts/15/SP.Taxonomy.js"></script>

SharePoint activate feature using CSOM C#

Create Simple K2 SmartForm

Open K2 Designer
(Click Start menu-->K2 Blackpearl-->K2 smartforms-->K2 Designer
Now we will create category based on project
In the K2 Designer, left side you can see "K2 Designer" root node, expand.
Right click on "All Items", click "New Category"
Enter some Name Ex: MyProject
Under "MyProject" create new categories
Called "Forms", "SmartObjects", "Views", "Workflows"
Right click on "Views"
Select "New View"
Click "Next" at "Introduction" screen
On the General screen, configure the new View.
Ex:
Name :Hello World
Category: MyProject\Views
View Type: Item View
Data Source: (leave blank)
Click Next. You should now be on the Layout screen.
On the Layout screen, click the Create Layout Table Only link and create a table with 2 rows and 2 columns.
From the Controls, panel, drag a Label control into the left-hand side of the table.
Use the Properties pane to change the Text property of the label to Hello World
Drag a Button control onto the form and drop it below the Hello World label
Use the Properties pane to set the Button’s Text Property to Hi

Now Add a Rule to the button...
Select the button you added in the last step, and then click on the Rules tab on the Properties panel to access the Button’s Rules
Click on the Add Rule button to start configuring a Rule. The Rules wizard configuration screen opens.
Because we selected a button when configuring the Rule, K2 already assumed that we want to define a Rule for the Button’s Clicked event. That is correct, so click Next
There are no Conditions we want to set for this Rule, so click Next
On the Actions step, click on the Show a Message Action under the Notifications category. You can either browse for the Action, or type message into the Search box and click the search icon to find the action.
Click on the Configure link in the Rule Definition section to set up the text for the message.
Configure the Show a Message to the User screen with the following options. Note that, for the Body section, we will drag a field from the context browser to show the current user’s Display Name.
Message Size :Small (320 x 240)
Message Type :Default
Title :Hello World
Heading : Hi
Body :Hello, [Display Name]
[Display Name] ---Drag from Context browser-->System Values-->Current user-->Display Name
Click OK to save the rule configuration and then click Finish to finish the Rule Wizard Configuration screen.

You have finished setting up the View, so click Next and then Finish.

After the View is saved, click the Run link to test the new View (You could also click either of the Designtime URL or Runtime URL links in the view properties screen as well)
Click the Hi button and confirm that a dialog box is shown. Notice that the current username is included in the message. Click OK to close the message box.

Create a Form to host the View:
In the category browser right click the "Hello World" View and select Generate Form.
Configure the Generate Form dialog box as follows.
Category :MyProject\Forms
Form Name :Hello World Form
Save the Form:Hello World
Click the OK button to create the new Form. The new Form is added to the category browser. This Form will contain the Hello World View that we created earlier. Notice the little green arrow indicating that the Form is currently checked-out. We must check the Form in before other users will be able to use it.
In the category browser, right-click the Hello World Form and select Check-In. Click OK on the warning message dialog that might appear.

Run the Form
In the category browser, locate the new Hello World Form we created in the previous step and select the Form. IN the Properties panel, copy and paste the Form's runtime url into notepad.
The URL should be something like:
http://k2Server.com/Runtime/Runtime/Form/Hello+World+Form/
Give this url to another user, and test it..

SharePoint 2013 Application pages Path


Application Page: After deploying Application page, it will move to sharepoint server. The path is: Hive\Template\Layouts\15\<ProjectName>
ASCX: After deploying User control, it will move to sharepoint server. The path is: Hive\Template\Layouts\15\controltemplates\<ProjectName>
In both cases, server side code will build as DLL and deployed in to GAC.
When project adds DLL in GAC, then SharePoint requires Apppool recycle.

Sunday, 2 November 2014

How do I get my solution in Visual Studio back online in TFS?

Close all VS 2013 instances
Open registry editor and go to:
KEY_CURRENT_USER\Software\Microsoft\VisualStudio\12\TeamFoundation\Instances\XXXX_This one will different based on your connection\Collections\You will some default connection
Click on "Offline"
Set value as 0
Open solution in VS. Afterwards pop up should appear which question would you like bring solution to online mode

If you are working with VS 2010

KEY_CURRENT_USER\Software\Microsoft\VisualStudio\10\TeamFoundation\Instances\XXXX_This one will different based on your connection\Collections\You will some default connection

Create k2 Custom Controls

Note: Custom controls will be used in K2 SmartForms.

How to create custom controls.
Need to add K2 related dlls

SourceCode.Forms.Controls.dll
SourceCode.Forms.Controls.Web.SDK.dll
SourceCode.Forms.Controls.Shared.dll
Add above dlls to your web application.

Create a class library.
Add above dlls.
Open .cs file, write code.

Setting a project item to Embedded Resource:
Click on the Item from project.
Go to Properties for the item.
Change the Build Action by selecting "Embedded Resource" from the dropdown

Add certificate.
Build your project, you will get one .Net .dll.
Now add that .Net .dll to SmartForms, using ControlUtil.exe.
C:\Program Files (x86)\K2 blackpearl\Bin
In this path u can find ControlUtil.exe