Tuesday, November 29, 2016

CAML: Filter URL field on description

In CAML query, 'complex' fields which store multiple values, only the 'default' value is available to query - by this I mean what would be available when SPField.GetFieldValueAsText() 

How to build a CAML query with where clause?

We can SPUserField as SPLookupField

<Query> 
     <Where> 
         <And> 
              <Eq> 
                  <FieldRef Name='UserField'/> 
                  <Value Type='Lookup'>" + username + "</Value> 
              </Eq> 
              <Eq> 
                   <FieldRef Name='UserField' LookupId='True' /> 
                   <Value Type='Lookup'>" + ID + "</Value> 
              </Eq>
         </And> 
     </Where> 
 </Query> 

Building CAML query with AND and Order by?

For Example:


<OrderBy>
<FieldRef Name="ID" Ascending="TRUE"/>
</OrderBy>
<Where>
 <And>
  <Eq>
   <FieldRef Name="HomeType"/><Value Type="Choice">Condo</Value>
  </Eq>
  <Eq>
   <FieldRef Name="LastName"/><Value Type="Text">Doe</Value>
  </Eq>
 </And>
</Where>

How to download the U2U CAML query Builder for SharePoint 2013?

CAML Designer

The one that works is this URL: http://camldesigner.blob.core.windows.net/offlinepackage/CamlDesigner2013.zip

The link comes from Karine Bosch's Blog. CAML Designer is the successor of CAML Builder, and from experience I can tell you this tool is much better and accurate. I've tried the both.

Edit: Looks like the CAML Designer now is a subscription application, but it is present on GitHub. https://github.com/chrisdee/Tools/tree/master/SharePoint/CamlDesigner

CAML Builder

But if you want the previous tool, the page to turn to is http://www.u2u.be/Software where you have the download at http://www.u2u.be/Downloads/U2U.SharePoint.CQB2010.zip which contains the wsp.

The CamlBuilderSetup.msi-file is located here: https://docs.google.com/file/d/0B1H-kV-5gwStUlF1OEdjWWJZNXc/edit?pli=1




U2U CAML Query Builder is now available again and updated for SharePoint 2013:

http://www.u2u.be/Software

Sharepoint service applications and Proxy Usage - Purpose of each component

  • Service
    This is the actual service, with its own engine, data storage, and infrastructure. It can be hosted on a specific server of the farm, or it can be a third-pary service. For example, this could be an external ERP, or it can be a software component that will be installed in the farm.

  • Service Instance
    Represents a single instance of the service, running on a server of the farm. There can be multiple instances of a service running on multiple application servers. The service application architecture gives you the ability to provide services in a scalable, multi-server configuration, with a load balancer to dispatch requests to the servers.
  • Service Application
    This is a logical layer that makes the back-end infrastructure available to the farm. Whenever you use a service application, you do not care about where and how it is exposed. You do not care about the number and location of the physical service instances. You simply access the service application as a logical service.
  • Service Application Proxy
    This is the proxy that virtualizes the access to the service application. In general, it is used on front-end servers of the farm and allows accessing the service application transparently and independently from its actual location.
  • Service Consumer
    This is a page, a Web Part, or whatever else that runs on a server of the farm, consuming a service application through its service application proxy.