Monday, February 8, 2016

Show online users count in SharePoint site

SharePoint site are more secure. So can use only https links in side them.
I have use a free widget to  show online user count. but i didnt work .

I made a customized version that widget to use in office 365 SharePoint.

Dowload the library :-  https://onedrive.live.com/redir?resid=1D7F31756D95FB7A!566&authkey=!AHBgHIO9oC0iftw&ithint=file%2cjs


Add the following script to your side (Or add to content editor)



<script id="_wauz68">var _wau = _wau || []; _wau.push(["classic", "9aa2far871tw", "z68"]); (function() { var s=document.createElement("script"); s.async=true; s.src="/sites/intranet/Style Library/EFL/js/classic.js"; document.getElementsByTagName("head")[0].appendChild(s); $("#asas").append(s); })(); </script>

Monday, December 14, 2015

The content database on the server is temporarily unavailable.

The content database on the server is temporarily unavailable.



When you try to deploy an app via Visual Studio, you might get the this error

Solution

Configure Managed Metadata service application correctly.

Check your domain ip in DNS server.(get your ip from ipconfing from CMD )
Also make sure you have the below service applications configured correctly

1. App Management Service Application.

2. Microsoft SharePoint Foundation Subscription Settings Service Application.

Then i looked in to Event Viewer. I found below problem 



Then I started  the Distributed Cache .



Then i deploy the solution the problem solved. 
:)

CAML Query for SharePoint


What is CAML?

  Ø  CAML - Collaborative Application Markup Language
  Ø  XML- Extensible Markup Language based query language
  Ø  Used to perform a query operation against SharePoint Lists
How SharePoint List Items are retrieved?
SharePoint List data can be retrieved in any one of the following ways:
1. Using the SharePoint object model – used when code runs on the server         (Example: Developing a web part or an application page)
2. Using the SharePoint Lists web service – used when your code doesn’t run on the server where the SharePoint is installed (Example: Developing a windows application)
3. Using Power shell –used mostly by the ADMIN of the SharePoint when they quickly want to retrieve some information from the SharePoint site

How does CAML query looks like?
As I already mentioned, it is XML based query language and it contains tags in it. The root element of the CAML query root element is Query. But it is not necessary to use Query element in the query you form.
Within the Query element you have two elements possible:

1. Where   – to filter the data
2. OrderBy – to categorize the data

A simple structure of the CAML query is as follows:
<Query>
          <Where>
                   <Eq>
                             <FieldRef Name=”FieldName” />
                             <Value Type=”DataType”>Value</Value>
                   </Eq>
          </Where>
          <OrderBy>
                             <FieldRef Name=”FieldName” />
                             <FieldRef Name=”FieldName” />
          </OrderBy>
</Query>

Operators in CAML Query
From the above structure, we came to know that it uses Where and OrderBy elements to retrieve the data from the list.

Let us know about the operators present in the CAML query and its usage:
Inside the Where element
1. Logical Operators - AND, OR
2. Comparison Operators - Listed Below in the table
AND – Which takes two conditions are satisfied
OR – Which takes when either of the conditions is satisfied


Comparison Operators
Inside the OrderBy/GroupBy element
OrderBy – Which orders or sort the data depends upon the field (FieldRef element) given.
GroupBy – Which groups the data depends upon the group by field (FieldRef element) given.
Examples
Logical & Comparison Operators
Use of AND, Gt, Leq
<Query>
<Where>
<And>
<Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
</Gt>
<Leq>
<FieldRef Name="Price" />
<Value Type="Number">2000</Value>
</Leq>
</And>
</Where>
</Query>
Use of OR, Gt, Leq
<Query>
<Where>
<Or>
     <Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
     </Gt>
                     <Leq>
  <FieldRef Name="Price" />
<Value Type="Number">2000</Value>
     </Leq>
               </Or>
       </Where>
</Query>
Use of BeginsWith, Leq
<Query>
<Where>
<And>
      <BeginsWith>
  <FieldRef Name="Title" />
  <Value Type="Text">M</Value>
      </BeginsWith>
      <Leq>
     <FieldRef Name="Quantity" />
<Value Type="Number">1000</Value>
      </Leq>
</And>
</Where>
<OrderBy>
<FieldRef Name="Price" Ascending="False" />
</OrderBy>
</Query>
OrderBy Operator
<Query>
<Where>
<Or>
    <Gt>
<FieldRef Name="Quantity" />
<Value Type="Number">0</Value>
   </Gt>
      <Leq>
<FieldRef Name="Price" />
<Value Type="Number">2000</Value>
   </Leq>
</Or>
</Where>
<OrderBy>
<FieldRef Name="Price" Ascending="True" />
</OrderBy>
</Query>
Is it possible to write this queries without any errors manually?
Yes. But we will know the errors only after executing the program. Hence there is a free CAML query builder which will generate the query easily.

Caml Queries to Remember

No Filter
<View><ViewFields><FieldRef Name="Title" /><FieldRef Name="Column2" /></ViewFields></View>
With Row Limit
<View><RowLimit>10</RowLimit><ViewFields><FieldRef Name="Title" /><FieldRef Name="Column2" /></ViewFields></View>
Above two can  be used with CamlQuery object as view xml.
example
CamlQuery camlquery = new CamlQuery();
               camlquery.ViewXml = "<View><RowLimit>10</RowLimit><ViewFields><FieldRef Name='Title'/><FieldRef Name='FileRef'/><FieldRef Name='BasePath'/></ViewFields></View>";
           
   List sSCConfigList = clientContext.Web.Lists.GetByTitle("SSCConfig");
               clientContext.Load(sSCConfigList);
               clientContext.ExecuteQuery();
               var listItems = sSCConfigList.GetItems(camlquery);
Single Select
Example
<Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">ABC VALUE</Value></Eq></Where></Query>
Multiple Rows
Example
<Query><Where><Contains><FieldRef Name="Title" /><Value Type="Text">Some Text</Value></Contains></Where></Query>
In case of Rich Text field, you can use <![CDATA[]]> around the value to prevent parsing errors when passing HTML into the query. Or you can replace < with &lt;, > with &gt; and “ with &quot; and so on.
Other operators are <Geq/> for greater than and <Leq/> for less than
LookUps
Here we use LookupId=”true”.  By using this we can specify the id value in the value tag
Look up on Id
example
<Query><Where><Eq><FieldRef Name="SomeLookupcolumn" LookupId="TRUE" /><Value Type="Lookup">4</Value></Eq></Where></Query>
Here It will filter on ‘SomeLookupColumn’ column here based on look up id and not value.  This ensures unique value.
This can be used to get person or group also
example
Filter on Current User
Example
<Query><Where><Eq><FieldRef Name="Author" LookupId="TRUE" /><Value Type="Integer"><UserID /></Value></Eq></Where></Query>
Notice here Valuetype is integer.
Using <UserID /> as the value, the query will filter based on the current user. You can also pass the ID of a specific user in place of <UserID /> (e.g. <Value Type="Integer">283</Value>) if you don’t want to filter by the current user.
Lookup on text
Example
<Query><Where><Eq><FieldRef Name="SomeLookupColumn" /><Value Type="Lookup">GujaratState</Value></Eq></Where></Query>
This will look for items with “GujaratState” in the look up column field. If there are more than one items having same display name, it will return all those items.
Date & Time
Example
<Query><Where><Eq><FieldRef Name="Modified" /><Value Type="DateTime"><Today /></Value></Eq></Where></Query>
A date can also be used instead in Value tag.  We can also use something like this <Today OffsetDays="-4" />

Wednesday, November 11, 2015

SharePoint 2013 : Creating Document Sets




Define the allowed content types. Select from the feature request content types and add each of these documents.
Choose each of the content types to tell SharePoint what should be provisioned when the document set gets created. You may not actually want to use the same template that’s defined on the content type here in the document set. These are the default pieces of content. Remove the default content type that’s just a blank word document.
Shared columns allow me to specify which of the default Meta data could also be created on the documents themselves. Out of the Meta data we created on the document set, I’ll create everything on the welcome page. If we have any content types already based on this one we can make an update. Select yes to do the update. Click ok.

The content type and document set are ready to go. 
1. Go under library settings
2. Enable the use of content types with the management of content types on this library under advanced settings.
3. Click allow the management of content types.
4. Scroll down and click ok.



5. From here add from existing content types. Add from my feature request document sets. Click ok.
Make sure the default word document is not an option when we go to create a document set. Make it invisible by unselecting the checked box under visible. The feature request document set is now the default content for this library. Open the default all documents view and add in the referred by, the request date and the request status, so they appear on the default view.



For more

Wednesday, September 16, 2015

Backup and Restore Site Collection

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>STSA
DM.EXE -o restore -URL http://spnt-dev-sql/sites/HNB/ -filename "C:\Backups\hnbb
ack.bak"

Another site already exists at 'http://spnt-dev-sql/sites/HNB/'. Choose a new UR
L, or specify the -overwrite flag to overwrite the existing site.


C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>STSA
DM.EXE -o restore -URL http://spnt-dev-sql/sites/HNB/ -filename "C:\Backups\hnbb
ack.bak" -overwrite

<nativehr>0x80070003</nativehr><nativestack></nativestack>


C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>STSA
DM.EXE -o restore -URL http://spnt-dev-sql/sites/HNB/ -filename "C:\Backups\hnbb
ack.bak" -overwrite

Friday, September 4, 2015

Error 1 Error occurred in deployment step 'Add Solution': A feature with ID

Error 1 Error occurred in deployment step 'Add Solution': A feature with ID 15/0e0c279a-04de-41d2-813d-6059f2ef3fdf has already been installed in this farm.  Use the force attribute to explicitly re-install the feature.



--  deletesolution

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>stsadm -o deletesolution -name HNB_Circular.wsp

-- iisreset

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>iisreset

--addsolution

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>stsadm -o addsolution -filename C:\Projects\HNB_Circular.wsp

-- deploysolution

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN>stsadm -o deploysolution -name HNB_Circular.wsp -url http://spm:1111/sites/hnb -immediate -allowgacdeployment

Tuesday, September 1, 2015

Workflow Manager Register Error , SharePoint 2013 on Windows 2012 R2

Microsoft SharePoint 2013 SP1, supports SharePoint installation on Windows 2012 R2 servers.

“SharePoint 2013 with service pack 1” and "Windows 2013 R2" can install without any errors.
when configuring Workflow Manager i had face many problem.

1. The most common error is “Register-SPWorkflowService The remote server returned an error: (404) Not Found”





To solve this issue we have to install
Service Bus Update
workflow manager cu 2
Before that ensure the workflow installation login should have the highest privilege as user()




























 SharePoint Designer 2013: App Management Shared Service Proxy is not installed
Standard
SharePoint Designer 2013: App Management Shared Service Proxy is not installed
Scenario:
When compiling the workflows in SharePoint Designer 2013 and publishing the workflow I faced the following Errors were found when compiling the workflow.
Further details on the error revealed Microsoft.SharePoint.SPException: App Management Shared Service Proxy is not installed.


Approach:
In order to resolve that I did the following:
Go To
  • Central Administration > Manage Services on Server
  • Check if App Manage Service is running
  • Central Administration > Application Management > Manage Service Application.
  • Check the App Management Service application is created, if not then create the App Management Service application.


Ensure: When creating the App Management Service it is important that this is enabled