Showing posts with label SharePoin2010. Show all posts
Showing posts with label SharePoin2010. Show all posts

Thursday, March 28, 2019

SharePoint - Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details


If you see this kind of error, make sure that is because the value which you are passing doesnt match with the data type present in the sharepoint list column

make sure what ever you are sending to sharepoint list matches the column data type, to figure out which column is causing the error, remove one by one column/filed in the item which you are passing or else you can check the error.responseText in error

Thursday, August 11, 2016

Minimizing/hiding sub tasks on a tasks list in office 365


By default sharepoint will show all the subtask on a tasks list to minimize them use the below script by adding script editor webpart on tasks pages

<script src="https://sharepointsiteurl/SiteAssets/JS%20file/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".ms-commentcollapse-icon").click();

        });
</script>

Saturday, July 23, 2016

Workflows getting suspended when sending emails outside company domain using SharePoint designer in O365


SharePoint 2013 designer workflows does not allow users to send emails out side their company domain the alternative is to start 2010 workflow from 2013 with email functionality or degrade the workflow version to 2010

Wednesday, July 13, 2016

Deleting data from workflow history list using JSON 

copy past the below code in script editor webpart.

<script src="https://sharepoint_yoursite/subsitename/SiteAssets/Java%20Script%20Files/jquery-1.10.2.js"></script>
    <script type="text/javascript">
var clientContext;
var website;
var oList;
var cnt = 0;
var collListItem;
// Make sure the SharePoint script file 'sp.js' is loaded before your code runs.
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);

// Create an instance of the current context.
function sharePointReady() {
    clientContext = SP.ClientContext.get_current();
    website = clientContext.get_web();
    oList = website.get_lists().getByTitle('Workflow History');

    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><RowLimit>1000</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);

    clientContext.load(website);
    clientContext.load(collListItem, 'Include(Id)');
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}

function onQuerySucceeded(sender, args) {

    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
        var ID = oListItem.get_id();
        var oListItemDel = oList.getItemById(ID);
        oListItemDel.deleteObject();
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onDeleteSucceeded), Function.createDelegate(this, this.onDeleteFailed));
        console.log(ID + " : Deleted");
    }
}

function onQueryFailed(sender, args) {
    console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}


function onDeleteFailed(sender, args) {
    console.log('Delete failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

function onDeleteSucceeded(sender, args) {
    cnt = cnt + 1;
    console.log('Delete success : ' + cnt);
}
</script> 

Monday, August 31, 2015

points to be noted on Event receivers in SharePoint 2013


properties.ErrorMessage is used for showing error in event handlers
properties.ListItem.Updateoverwriteversion() is used to overwrite version in list item, rather than adding a new version to the item it overwrites the existing one.
this.EventFiringEnable = false or True to stop or start the events on a list item, when ever you use "Updateoverwriteversion()" method inside a event we should set "this.EventFiringEnable= True" to stop the recursion 

Monday, April 27, 2015

Oracle LDAP and SharePoint 2013 integration

I have came across a post for oracle and SharePoint 2013 integration, i think this will help other too.

http://blogs.msdn.com/b/ronalg/archive/2014/04/14/sharepoint-2013-and-forms-based-authentication-configuration-for-open-ldap.aspx


Tuesday, March 11, 2014

1.difference between visual webpart and a standard webpart'
the SharePoint 2010 Visual Web Part is an ASCX web user control that is hosted inside a standard Web Part.

2.Difference between web user control and webpart
user control:
a.User controls must be compiled before use, which adds to the time it takes to load the control.
b.The Visual Web Developer designer provides support for designing the UI by using drag-and-drop operations that gives the control a consistent look-and-feel, which results in faster development.
Webpart:
a.Web Parts are precompiled and ready for use as soon as you need them.
b.The controls in Web Parts must be added by using code.

3.SharePoint site pages vs application pages
Site Pages:- Site Pages are Site or Web Scoped, User can customize Site Pages, Site Pages are stored in Content Database,
You cannot have custom code in Site Pages, Site Pages are Un-ghosted Pages.

Application Page:-
Application Pages are farm scoped, No customization can be done by the user, Application Pages are stored in WFE(Web Front End) in _layouts folder, You can have custom code in your Application Pages, Application Pages are Ghosted Pages.

4.Difference between WFE and application server
Microsoft SharePoint Foundation Web Application makes WFE in SharePoint farm

5.Difference between page library and site library
The Pages library is for storing Publishing Pages whereas the Site Pages library is for storing wiki and web part pages.
You only get the Pages library once the SharePoint Server Publishing feature is activated on the site. This library is usually used when you have requirements for content-centric pages that may use the scheduling, workflow and caching capabilities of SharePoint; such as in the case of public-facing websites. In a more collaborative scenario, you'd want to use the Site Pages library to create wiki and web part pages.

Saturday, March 16, 2013

Sandbox solutions support:

  1. Web parts
  2. Event Receivers
  3. Workflows
  4. List definitions

What is Sandbox solutions and its limitations


Sandbox solution is a new feature introduced in SharePoint 2010. It's a secured wrapper around webparts and other elements with limitations. There is no thumb rule that every webpart in SharePoint 2010 belongs to Sandbox Solution. But it's recommended to develop webparts with Sandbox solution. It allows administrators to monitor the solutions and control as required. SharePoint Site Collection administrators can view the resource utilization of each solution and can block if it consumes too much resources. Usually when sites working slow, developers complain the server is slow whereas site/server administrators blame on Develepor code/solutions. Now Microsoft put a Full Stop to that. :)

Technically speaking SharePoint solutions run in seperate worker processes and not in w3wp.exe. So It doesn't require IIS Reset or Application Pool Recycling. Without disturbing the SharePoint site, Sandbox solutions can be deployed. Only thing while deploying new version of Sandbox solution over existing solution, SharePoint will display No Solution found error in Sandbox Webparts on the page. However within seconds sandbox solutions getting deployed and it'll start working. In SharePoint 2007, only farm administrators can install/deploy developer solutions. But Now site collection administrators can deploy solutions with web based interface. This reduces the dependency of Farm Administrator and improves rapid deployment.

Sandbox Processes
Here the processes which required for Sandbox solutions.
  1. SPUCWorkerprocess.exe - Sandbox Worker process service which is a Seperate Service Application which actually executes Sandbox code. It should be started in every farm to use Sandbox solutions.

  2. SPUCWorkerProcessProxy.exe - Sandbox Worker process proxy which is working as a proxy for Worker process and takes care of Sandbox code execution. It can also serve to other farms if configured. Basically it helps site administrator for load balancing.

  3. SPUCHostService.exe - Sandbox User Code Service takes care of user code in Sandbox amd it can be started in the farms where to use Sandbox solutions.
Sandbox Limitations
As I said before, Sandbox is a secured wrapper and it has restrictions on code to run in SharePoint environment. Few Key limitations which developers should know are listed below.
  1. No Security Elevation - RunWithElevatedPrivileges which runs the specified block of code in application pool account(typically System Account) context is not allowed in Sandbox code. SPSecurity class also not allowed to use in Sandbox.

  2. No Email Support - SPUtility.SendMail method has been blocked explicitly in Sandbox, However .Net mail classes can be used to send mails. Additionaly sandbox won't allow to read Farm SMTP address. So developers has to specify the SMTP address in code itself(may be some other workaround).

  3. No Support to WebPartPages Namespace - Sandbox won't allow to use Microsoft.SharePoint.WebPartPages namespace.

  4. No Support to external Webservice - Internet web service calls are not allowed to ensure security in Sandbox solutions. Allow Partially Trusted code also can't be accessed within Sandbox.

  5. No GAC Deployment - Sandbox solutions are not stored in File System(Physical path) and assemblies can't be deployed to Global Assembly Cache(GAC). But it's available on C:\ProgramData\Microsoft\SharePoint\UCCache at runtime. Note the ProgramData is a hidden folder.

  6. No Visual Webparts - Visual Studio 2010 by default won't allow to create Visual Webparts to deploy as sandbox solution. But with Visual Studio PowerTools extensions(downloadable from Microsoft MSDN website) Visual Webparts can be developed and deployed as sandbox Solutions.
SharePoint Online which is SharePoint environment provided by Microsoft to manage SharePoint Sites in internet accepts only Sandbox solutions. Because SharePoint Online sites are Windows Servers at Microsoft Datacenters, Microsoft won't allow GAC deployment or file system access. In future Sandbox solution will give more features for developers.

Thursday, November 29, 2012

Difference between Web Application,Site Collection,Site and sub site in SharePoint 


 Web Application
       -->Site Collection (SPSite)( A site collection cannot be physically seen in SharePoint)
              --> Site (SPWeb)
              --> Site (SPWeb)
      --> Site Collection (SPSite)
              --> Site (SPWeb)
                    --> Sub Site (SPWeb)
                    --> Sub Site (SPWeb)
The words between ( ) are the objects of the SharePoint API.

SharePoint - Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details If y...

Ad