If somebody like the post and its helpful in your work then, add comments.
Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Friday, May 22, 2015

SharePoint ECMA : Get pages library items in ECMA

To get the pages library items,  using the JavaScript/JSOM. For that in the clientContext.load we have to pass "File" parameter and than the site columns(internal names)

getNewsPages = function() {
                 var clientContext = new SP.ClientContext.get_current();
                var oList = clientContext.get_web().get_lists().getByTitle('Pages');
                var camlQuery = new SP.CamlQuery();
                camlQuery.set_viewXml(" 50");
                selectedDoc = oList.getItems(camlQuery);
                clientContext.load(selectedDoc , 'Include(Id, Title,File,PublishedDate1,TeaserText,TeaserImage,FileRef,NewsFilter)');
                clientContext.executeQueryAsync(gettingNewsPagesSuccess , onQueryFailed);

            },
            gettingNewsPagesSuccess = function() {
                var listItemEnumerator = selectedDoc.getEnumerator();
                while (listItemEnumerator.moveNext()) {
                    var oListItem = listItemEnumerator.get_current();
                    tempList.push({
                        "Id": oListItem.get_id(),
                        "Title": oListItem.get_item('Title') ,
                        "PublishedDate": oListItem.get_item('PublishedDate1'),
                        "TeaserText": oListItem.get_item('TeaserText') ,
                        "TeaserImage": oListItem.get_item('TeaserImage'),
                        "Path": oListItem.get_item('FileRef'),
                        "NewsFilter": oListItem.get_item('NewsFilter')
                    });
                }

            },

Monday, May 5, 2014

SharePoint 2010 : Share value between itemupdating and itemupdated events in SandBox Event receiver

 

Well, create one column in the Main List, where values are changes say "OLDVALUES". Set that field using the properties.ListItem["OLDVALUES"]=Value1+";" +Value2+";" +Value3+";"; in ItemUpdating event(take Value1, Values2 and Value3 using the properties.ListItem["Value1"] and son on).

Now in Item Updating, use like string oldValue = properties.ListItem["OLDVALUES"].ToString(); and slip in array and then you can set global variables and access them in your code. Remember its a SandBox solution approach for event receivers, not for farm solution.

Tuesday, October 8, 2013

SharePoint : Open the list item directly to edit mode.

To open the list item directly to edit form instead of the display form.

image

Then we have to edit the view on which the list item is showing. Just open the view in the designer in advanced mode and click on the “Title” column=>SQL server basics.

image

And see the properties which are associated,

image

Change the HREF property to below property just change the “$FORM_DISPLAY” to “$FORM_EDIT”

{$FORM_EDIT}&ID={$ID}&ContentTypeID={$thisNode/@ContentTypeId}

Monday, November 7, 2011

SharePoint 2010 : Enhancements for Developers in SharePoint Foundation

 

Enhancement

Benefit

Service application architecture

Redesigned infrastructure to facilitate sharing of resources across Web applications and farms.

Windows PowerShell support New support and capabilities for writing administrative scripts.
Feature versioning and upgrade New support for versioning and upgrading features.

SharePoint Developer Tools for Visual Studio 2010

A first-class development experience for SharePoint developers (finally).

Sandboxed solutions

New support for deploying solution packages at site collection scope in a sandboxed environment.

New features for throttling lists and controlling
query execution

Enhanced support for stabilizing the farm by prohibiting large,inefficient queries.

New events for sites, lists, and workflows

Additional events for developers to hook up event handlers.
LINQ to SharePoint provider

New support for writing LINQ query statements to access SharePoint list data.

REST-based access to SharePoint list items

New support for accessing SharePoint list data from across the network using REST-based Web service calls.

Client-side object model

Ability to leverage the SharePoint object model from across the network when programming with .NET, Silverlight, and JavaScript

Enhanced support for integrating Silverlight applications

Rich support for deploying and versioning Silverlight applications within a SharePoint environment

Claims-based security

New authentication support for leveraging external identity management systems and extending access control in SharePoint sites using custom claims

Business Connectivity Services (BCS) and external lists

New support for creating read-write connections to back-end databases and line-of-business systems and exposing their data as lists within SharePoint sites

NET Assembly Connectors for BCS

Support for creating a custom component to integrate any data source with the BCS.

Thursday, July 21, 2011

SharePoint 2010 : Import List workflow in your custom solution

When you have to import the workflow in your solution, like for Sandbox solution. So, how you will be importing that list workflow in the VS 2010 sandbox solution. Many of us find like import reusable workflow in the VS 2010 solution. But what about the list workflows. And suppose if their is more then one workflow. I have also search lot on this topic and does not get not much help.

Solution Smile!!!!!!!!!!!!!!

To import List workflow on the VS solution. Create a WSP of the Site and import using the VS template  for SharePoint. Now Copy the ListInstances(On which list workflow are created),Modules of the workflow and WorkflowAssociations folders in our custom solution. Now build the solution. It will give some errors of workflow. So over come the errors add reference of following references

  • microsoft.sharepoint.WorkflowActions
  • System.Workflow.Activities
  • System.Workflow.Runtime

It will resolve the some of the errors. Now it will be giving the XOML errors. So to overcome these errors,you have add the same line of the tag from “importsolution.csproj” file to “customsolution.csproj”. Make it similar as import solution.

The changes should be done for workflow.xoml, workflow.xoml.wfconfig.xml and workflow.xoml.rules for all the workflow which are associated with all the list in the WSP. Now all the error will resolved. Deploy the solution and test. The workflow will work fine.

It will help in creation and deployment for the sandbox and SPD workflow. Comment if any help needed.

SharePoint 2010 : Creating a Web/Site template

What Are Web Templates in general?
We can a web site template is a pre-designed web page or simply a web page without or with basic contents. Right?

What is web template in the SharePoint term?
Web templates on the other hand, are stored in the database, and are created using an existing site, with or without its specific content, as a model. This provides a means for reusing sites that you have customized.

In SharePoint 2007/2010 the meaning is same for both the version. But creating a web template is now different in the both version, means approach is different.
Like in MOSS we can create the web template using the existing site, SPD 2007 for UI and WSP for deployment. But in the SharePoint now you can create your Custom Web template using the SharePoint existing site. Well, for the custom template first you have to design and implement all the requirement on the existing site, and save the template in the Site templates. But here is the slightly change, we can create two types of the site template solution,
Farm
Sandbox
In VS 2010 their is a new template for the creating the solution from existing WSP is Import SharePoint Solution Package.

Import SharePoint Solution Package

Now you can import your WSP in this solution and you can write your custom code or now you can modify UI etc. It will give great help when you are creating a sandbox solution and does not want to write a code. then just deploy all the solution on existing site and use that site WSP to import in this solution. Extract your required solution from it and implement in the your solution.