Posts

Showing posts from 2021

Create SharePoint Site Collection in a specific Content DB In SharePoint using PowerShell

As the SharePoint Central Administration doesn’t provide any interface to create a site collection with a nominated content database, we need to use PowerShell commands to create a site collection in a new content database for SharePoint on-premise. #Create a SharePoint New Content Database New-SPContentDatabase -name <<WSS_Content_DB_Name>> -webapplication <<http://Web_App_URL>> Create Site Collection in the previously created Content DB #Create a Site collection in the specific content database New-SPSite -Name "<<Site_Collection_name>>" -ContentDatabase <<WSS_Content_DB_Name>> -url <<Site_Collection_URL>> -OwnerAlias "domain\primary_Admin" -SecondaryOwnerAlias "domain\Secondary_admin" -Template "BLANKINTERNET#0" Here the template is the required site collection template. Some of the common template codes are below: Team Site: STS#0 Blank Site: STS#1 Wiki Site: WIKI#0 Blog: BLOG#0 App

SharePoint Get list items from List view- REST API

In the below code snippet, call the  getListViewItems method by passing the weburl, list title and the viewname. function   executeJson ( url ,  method ,  headers ,  payload ) {      method  =  method  ||  'GET' ;      headers  =  headers  || {};      headers [ "Accept" ] =  "application/json;odata=verbose" ;      if  ( method  ==  "POST" ) {          headers [ "X-RequestDigest" ] =  $ ( "#__REQUESTDIGEST" ). val ();     }      var   ajaxOptions  = {          url :   url ,          type :   method ,          contentType :   "application/json;odata=verbose" ,          headers :   headers     };      if  ( typeof   payload  !=  'undefined' ) {          ajaxOptions . data  =  JSON . stringify ( payload );     }      return   $ . ajax ( ajaxOptions ); } function   getListItemsByCAML ( webUrl ,  listTitle ,  queryText ) {      var   viewXml  =  '<View><Query>'  +  queryText  +  '</Query>

SharePoint Get list items by CAML query - REST API

 Below is the javascript code for getting list items by CAML Query. function   executeJson ( url ,  method ,  headers ,  payload ) {      method  =  method  ||  'GET' ;      headers  =  headers  || {};      headers [ "Accept" ] =  "application/json;odata=verbose" ;      if  ( method  ==  "POST" ) {          headers [ "X-RequestDigest" ] =  $ ( "#__REQUESTDIGEST" ). val ();     }      var   ajaxOptions  = {          url :   url ,          type :   method ,          contentType :   "application/json;odata=verbose" ,          headers :   headers     };      if  ( typeof   payload  !=  'undefined' ) {          ajaxOptions . data  =  JSON . stringify ( payload );     }      return   $ . ajax ( ajaxOptions ); } function   getListItemsByCAML ( webUrl ,  listTitle ,  queryText ) {      var   viewXml  =  '<View><Query>'  +  queryText  +  '</Query></View>' ;      var   url  =  webU

Nintex Workflow publish error: System.CodeDom.CodeTypeReferenceExpression is not marked as authorized in the application configuration file

Image
When publishing the Nintex Workflow on SharePoint On-prem, we might get following error: soap:ServerServer was unable to process request. ---> Failed to publish workflow: <Error><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeTypeReferenceExpression is not marked as authorized in the application configuration file." Solution: As per the Microsoft Docs, below is the solution: Workflow Foundation (WF) will only run workflows when all the dependent types and assemblies are authorized in the .NET config file (or added explicitly via code) under this tree: <configuration> <System.Workflow.ComponentModel.WorkflowCompiler> <authorizedTypes> <targetFx> However, after the update, the following lines are necessary for SharePoint 2013 and beyond: <authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace=

SharePoint site collection backup restore with Nintex Forms and Nintex workflows

If you are using the Microsoft SharePoint on-prem with Nintex Forms and Nintex Workflows, there might be a question on how to move the site with forms and workflows to Client environment Or from dev/test/staging environment to the test/production environment. Here are some of the ways and highlights which i hope will help you. If you are planning to move only the Lists- which are having Nintex Forms, then there are few aspects to be considered: If you have only few lists, then you can use List template (.stp) and restore it on the destination environment. This will also have the Nintex forms along with it. However, if you have many Lookup columns in your List, then once you create the List using List template, the lookup column references will be lost. you need to delete all lookup columns and re-create. Moving Nintex forms for already created lists, You can export the Nintex Form xml file and restore it. If you want to move the Workflows, then export the Nintex workflow files (.nwf) f