Posts

Get Choice Field values using Client Side Object Model in SharePoint 2013

ClientContext context = new ClientContext(source_site_url);            List list = context.Web.Lists.GetByTitle(list_name);            Field choice = list.Fields.GetByInternalNameOrTitle("jobtitle");            FieldChoice fldChoice = context.CastTo<FieldChoice>(choice);            context.Load(fldChoice, f => f.Choices);            context.ExecuteQuery();            Foreach (string item in fldChoice.Choices)            {                control_name.Items.Add(item.ToString());    ...

Check UserID exists in Active Directory

Please add the  System.DirectoryServices.AccountManagement namespace and assembly to your code. public string DoesUserExist(string userName)         {               using (var domainContext = new PrincipalContext(ContextType.Domain, "spl"))             {                 using (var foundUser = UserPrincipal.FindByIdentity(domainContext, IdentityType.SamAccountName, userName))                 {                     if (foundUser != null)                 ...

Downloading WSP from Central Administration

using powersell we ca achive this.   $farm = Get-SPFarm $file = $farm.Solutions.Item("Nameofthewsp.WSP").SolutionFile $file.SaveAs("C:\Backup\Nameofthewsp.WSP")

WebProvisioned event in SharePoint 2010

This is event comes with SharePoint 2010 , that allows us to execute something when a sub site in the site collection get created. Here we will see an example that will change the Theme of the sub site whenever the sub site will get created. A point to remember is this event does not fire when the root web site of a new site collection is created. This method can be configured to operate in either synchronous or asynchronous modes. And this can be set in Synchronization tag in the Elements.xml file. To do this we have create an event receiver and we have to write code in the Web Provisioned event, that will responsible to change the Theme of the newly created site.

infopath Usefull Function's for sharepoint

substring-before(): Syntax: substring-before(field1,field2) Her it will return the text presented in field1 that precedes the first occurrence of field2. Example: substring-before("ABC PQR"," ") will return "ABC". Here we are doing string manipulation based on blank space. Similarly substring-after ("ABC PQR "," ") will return "PQR" sbustring("ABC",1,1) - This will return "A". Replace blank spaces with underscores (_). I was just thinking if there is any direct function for replace which was not there.The way I did by using the translate function. Open the Insert Formula dialog box (Open the Rule Details dialogbox and then click on fx in the Value textbox). Then in the Insert Formula write the function like below: translate(Title," ","_") . Convert To UPPER case: translate(my:FieldName, "abcdefghijklmnopqrstuvwyxz", "ABCDEFGHIJKLMNOPQRS...