Tuesday, December 29, 2015
Tuesday, December 15, 2015
Property sync is not dispayed
http://www.sharepoint2013.me/Blog/Post/88/Managed-property-added-to-search-display-template-is-not-appearing-in-sharepoint-2013
$ssa = Get-SPEnterpriseSearchServiceApplication $tenantOwner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb "https://dev.contoso.com/search/" Get-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $ssa $ResultType = Get-SPEnterpriseSearchResultItemType -SearchApplication $ssa -Owner $tenantOwner | where-object { $_.Name -eq "ContosoResultType" } $ssa.UpdateResultItemType($ResultType)
New Managed Properties don't contain values
http://sharepoint.stackexchange.com/questions/122486/new-managed-properties-dont-contain-values
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue
Stop-Service SPTimerV4
$folders = Get-ChildItem C:\ProgramData\Microsoft\SharePoint\Config
foreach ($folder in $folders)
{
$items = Get-ChildItem $folder.FullName -Recurse
foreach ($item in $items)
{
if ($item.Name.ToLower() -eq "cache.ini")
{
$cachefolder = $folder.FullName
}
}
}
$cachefolderitems = Get-ChildItem $cachefolder -Recurse
foreach ($cachefolderitem in $cachefolderitems)
{
if ($cachefolderitem -like "*.xml")
{
$cachefolderitem.Delete()
}
}
$a = Get-Content $cachefolder\cache.ini
$a = 1
Set-Content $a -Path $cachefolder\cache.ini
read-host "Do this on all your SharePoint Servers - and THEN press ENTER"
start-Service SPTimerV4
Friday, November 20, 2015
page library errror
System.Runtime.InteropServices.COMException: The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan., StackTrace:
at Microsoft.SharePoint.SPFileCollection.AddStreamOrBytesInternal(String urlOfFile, Stream file, Int64 fileSizeToSave, SPFileStreamManager spmgr, PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID, Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified, Object varProperties, String checkInComment, Stream formatMetadata, String lockIdMatch, String etagToMatch, SPLockType lockType, String lockId, TimeSpan lockTimeout, Boolean validateRequiredFields, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage, String& etagNew, Boolean& ignoredRequiredProps)
at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, SPFileCollectionAddParameters parameters)
at Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass27.<AddPublishingPage>b__22()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.SharePoint.Publishing.PublishingWeb.AddPublishingPage(String name, PageLayout layout, SPFolder folder)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.CreateStandardPage(String pageName)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.ButtonCreatePage_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
-------------------------------
CreatePage: exception The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at
at Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass27.<AddPublishingPage>b__24()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.SharePoint.Publishing.PublishingWeb.AddPublishingPage(String name, PageLayout layout, SPFolder folder)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
---------------------------
Application error when access /_layouts/15/CreatePage.aspx, Error=The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
---------------------------
System.Runtime.InteropServices.COMException: The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
-------------------
Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan. ---> System.Runtime.InteropServices.COMException: The file "/test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps) -
-- End of inner exception stack trace ---
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.HandleUnexpectedException(PublishingPage newPage, Exception exception)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.CreateStandardPage(String pageName)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.ButtonCreatePage_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at Microsoft.SharePoint.SPFileCollection.AddStreamOrBytesInternal(String urlOfFile, Stream file, Int64 fileSizeToSave, SPFileStreamManager spmgr, PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID, Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified, Object varProperties, String checkInComment, Stream formatMetadata, String lockIdMatch, String etagToMatch, SPLockType lockType, String lockId, TimeSpan lockTimeout, Boolean validateRequiredFields, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage, String& etagNew, Boolean& ignoredRequiredProps)
at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, SPFileCollectionAddParameters parameters)
at Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass27.<AddPublishingPage>b__22()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.SharePoint.Publishing.PublishingWeb.AddPublishingPage(String name, PageLayout layout, SPFolder folder)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.CreateStandardPage(String pageName)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.ButtonCreatePage_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
-------------------------------
CreatePage: exception The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at
at Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass27.<AddPublishingPage>b__24()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.SharePoint.Publishing.PublishingWeb.AddPublishingPage(String name, PageLayout layout, SPFolder folder)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
---------------------------
Application error when access /_layouts/15/CreatePage.aspx, Error=The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
---------------------------
System.Runtime.InteropServices.COMException: The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
-------------------
Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: The file "test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan. ---> System.Runtime.InteropServices.COMException: The file "/test123.aspx" is checked out for editing by i:0#.w|agi\pkarnan.
at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr, Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32& pbIgnoredReqProps) -
-- End of inner exception stack trace ---
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.HandleUnexpectedException(PublishingPage newPage, Exception exception)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.CreateStandardPage(String pageName)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.ButtonCreatePage_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Tuesday, October 6, 2015
Workflow issues
https://social.technet.microsoft.com/Forums/sharepoint/en-US/a2d4fc63-18dd-496f-82d0-6759f4710afe/workflows-involving-email-not-working-after-reboot?forum=sharepointadmin
http://www.akspug.org/Blog/Post/4/Request-Management-and-Error-8316
http://amolmeshe.blogspot.in/2013/05/sharepoint-2013-request-management.html
http://www.cleverworkarounds.com/2013/12/22/trials-or-tribulation-inside-sharepoint-2013-workflowspart-4/
Thursday, September 24, 2015
post render in angular
http://stackoverflow.com/questions/29273740/max-height-and-nanoscroller-angularjs-ngrepeat
Thursday, September 10, 2015
override specific templates in AngularUI Bootstrap?
http://www.ngroutes.com/questions/1adab29/angular-ui-bootstrap-datepicker-add-custom-function-to-template.html
http://www.codeproject.com/Tips/803247/Datepicker-directive-using-AngularJS-and-Bootstrap
http://stackoverflow.com/questions/17660947/can-you-override-specific-templates-in-angularui-bootstrap
https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.4.0.js#L2938
http://jsfiddle.net/the_menace/ddvg5wg1/
http://stackoverflow.com/questions/26749027/how-to-override-angular-ui-bootstrap-datepicker
http://plnkr.co/edit/YLJW2imcDAbzwsvp58Rl?p=info
angular ui without template
https://github.com/angular-ui/bootstrap/tree/master/src
http://stackoverflow.com/questions/23566224/angular-templates-return-404-when-js-is-minified
SP.Appcontext for hosted sharepoint apps
https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListGetItems
http://sharepoint.stackexchange.com/questions/136482/sharepoint-rest-api-using-caml-query-and-select-expand-to-get-lookup-data
http://blog.ctp.com/2014/04/28/performing-rest-operations-on-host-webs-from-sharepoint-hosted-apps/
http://sharepoint.stackexchange.com/questions/76645/sharepoint-2013-rest-possible-to-upload-accross-site-collections-with-embeded
SharePoint: Using deferreds/Promises Or Callbacks in Javascript client object model
http://www.sharepointnadeem.com/2014/10/sharepoint-using-deferredspromises-or.html
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/09d122a4-943f-4db6-ae6f-7454e11ec3b5/jsom-executequeryasync
http://sharepoint.stackexchange.com/questions/97656/js-library-for-rest-and-jsom-sharepoint-basic-tasks
http://sharepoint.stackexchange.com/questions/144512/jsom-promise-method-on-sharepoint-2010-site
http://blog.qumsieh.ca/2013/10/31/using-jquery-promises-deferreds-with-sharepoint-2013-jsom/
Tuesday, September 8, 2015
Saturday, August 29, 2015
CRUD Operation to List Using SharePoint 2013 Rest API
http://www.codeproject.com/Articles/990131/CRUD-Operation-to-List-Using-SharePoint-Rest-API
User Profile service application in SharePoint 2013
http://www.c-sharpcorner.com/UploadFile/746cd9/user-profile-service-application-in-sharepoint-2013/
Import User Photos From Active Directory Into SharePoint 2013
http://richardstk.com/2013/04/12/import-user-photos-from-active-directory-into-sharepoint-2013/
SP2013: Setting people picker value in NewForm.aspx
http://jaredmatfess.com/2015/03/sharepoint-2013-client-side-people-picker-on-edit-form-page/
http://www.sharepointcolumn.com/sp2013-setting-people-picker-value-in-newform-aspx/
http://www.codeproject.com/Articles/1008871/Developing-Custom-Date-Picker-People-Picker-and-Ch
http://www.codeproject.com/Articles/783581/Client-people-picker-on-a-custom-SharePoint-form
Friday, August 28, 2015
Person or Group field using REST API
=>SharePoint 2013: Get User Details from Person or Group field using REST API
http://social.technet.microsoft.com/wiki/contents/articles/31210.sharepoint-2013-get-user-details-from-person-or-group-field-using-rest-api.aspx
=>REST API reference and samples
https://msdn.microsoft.com/en-us/library/office/jj860569.aspx
=>How to get User Details and User Group Details in SharePoint 2013 REST API with Knockout for SharePoint Js (KoSpJs)
http://www.ashokraja.me/post/How-to-get-User-Details-and-User-Group-Details-in-SharePoint-2013-REST-API-with-Knockout-for-SharePoint-Js-%28KoSpJs%29.aspx
=>Pulling user/group field data from SharePoint list using REST, jQuery, Knockout.js Sharepoint 2013
http://www.codeexplain.com/code/29658396-490f-4a6f-9b10-14a2883f494a
=>Use the client-side People Picker control in SharePoint-hosted SharePoint Add-ins
https://msdn.microsoft.com/en-us/library/jj713593.aspx
=>REST POST: How to add a list item with 'people and group', 'choice,' and 'URL' fields?
http://sharepoint.stackexchange.com/questions/71827/rest-post-how-to-add-a-list-item-with-people-and-group-choice-and-url-f
http://stackoverflow.com/questions/16500077/how-to-add-user-to-sharepoint-list-item-user-field-using-rest-api-in-sp2013
http://stackoverflow.com/questions/14556418/saving-a-person-or-group-field-using-rest
Thursday, August 27, 2015
sharepoint apps with Angular js
http://www.dotnetcurry.com/sharepoint/1121/developing-sharepoint-2013-apps-angularjs
http://www.codeproject.com/Articles/1002526/SharePoint-and-Angularjs
http://www.jeremythake.com/2013/10/sharepoint-hosted-app-with-angularjs-for-mvc-javascript/
https://auth0.com/authenticate/angular/sharepoint
http://www.threewill.com/adding-angularjs-to-sharepoint/
http://www.jeremythake.com/2013/10/sharepoint-hosted-app-with-rest-angularjs-for-mvc-javascript/
http://sharepoint.stackexchange.com/questions/137556/can-we-retrieve-list-data-using-angularjs-in-sharepoint-2013-hosted-app
http://www.dotnetcurry.com/sharepoint/1121/developing-sharepoint-2013-apps-angularjs
Developing SharePoint 2013 Apps using Angular.js
Posted by: Mahesh Sabnis , on 4/23/2015, in Category SharePoint
Views:
6695
Abstract: In this article, we will implement a
SharePoint App using Angular.js. The Services and Controller features
of Angular.js can be used to manage the SharePoint model declaration
(controller scope objects) and external service calls (services)
segregation will help to develop Apps for SharePoint effectively.
This article was updated on April 26th to reflect the
comments by Rafael and Ravi. Thanks to Ravi Kiran for technically
reviewing this article. Thanks Rafael for pointing out the error and
Mahesh for fixing it.
The App Model introduced in SharePoint 2013 allows JavaScript Developers to develop Apps for SharePoint. In previous versions of SharePoint, running apps in full trusted mode would make the SharePoint server unstable which increased the maintenance costs. Although sandbox solutions existed, the restrictions applied were stringent which forced devs to run even untrusted custom code, in full-trust mode.
In SharePoint 2013, everything (which includes Lists, Libraries etc.) is an app. The JavaScript programming feature of App for SharePoint executes the custom code on a separate server e.g. Cloud, IIS, or even the client browser. This new model of SharePoint 2013 can allow access of Lists and Libraries in JavaScript using the JavaScript Object Model (JSOM). Before starting with a SharePoint App, we need to keep the following facts in mind.
Editorial Note: If you are absolutely new to Angular.js, check this Angular article series by Praveen that brings you up to date with Angular.
In this article, we will be using SharePoint 2013 Online and the Developer site created on it. Alternatively this application can be used in an On-Premise SharePoint application also. The prerequisites for this article is to have a basic knowledge of SharePoint 2013, especially creating Lists.
Step 1: Open the SharePoint online portal using http://portal.microsoftonline.com. Login with your subscription. (Alternatively, on-premises SharePoint 201 installation can be used). Create a new developer site and a Custom List named CategoryList as shown in the following figure:
The list will have CategoryId and CategoryName columns. Note that the default Title Column is renamed to CategoryId. The programming always uses the Title as column name.
Step 2: Open Visual Studio 2013 and create a new App for SharePoint and name it SPNG as shown in the following figure.
Set the SharePoint site for SharePoint hosted App as shown in the following figure:
Step 3: Once the app is created add the AngularJS Framework, jQuery and Bootstrap JavaScript libraries using Manage NuGet Package in the project.
Step 4: In the Scripts folder, add a new folder and name it MyScripts. In this folder, add the following JavaScript files:
Module.js
The above code is for creating an Angular.js module. This is the entry point for our application.
Service.js
The above code is very important, it has the following features:
The above controller code has the following features
Step 5: Open Default.aspx and add the following script references:
The above references are used to load Angular Framework and the bootstrap library for the RICH UI.
Step 6: Add the following markup in the PlaceHolderMain of Default.aspx
In the above markup, the <div> tag is bound with the spsmodule and spscontroller. In the markup the <input> elements are bound with the Category properties using ng-model and
the <input> button is ng-click bound with the functions defined
in the controller. All the ng-click function bindings are passed with
the $event parameter. This object contains
information about the event and is used to prevent the page from
post-back. The markup contains a table which is ng-repeat bound
with the Categories array declared in the controller. This is used to
generate the table rows based on the data in the object CategoryList
List.
Step 7: Since we need to perform a Read/Write operations on the List using App, we need to apply access rights. In the project we have an AppManifest.xml. This is used to set the App permissions. Double-Click on this file and set the permissions as shown in the following figure:
Here we need to set permissions on the Web Sire and the List, so that we can perform Read/Write operations.
Run the application, after deployment we can set the trust for the app as shown here:
Click on Trust It and the following result will be displayed:
Enter Category Details in the textboxes and click on the Save button, the new category record added in the table will be displayed as shown in the following figure:
Conclusion: The SharePoint App Model can be developed effectively using a client-side library like Angular.js. The abstractions provided by Angular fit very well into the SharePoint ecosystem and hence we can develop rich interfaces using this combination. The abstractions also help us in keeping the code base pretty clean.
Download the entire source code of this article (Github)
The App Model introduced in SharePoint 2013 allows JavaScript Developers to develop Apps for SharePoint. In previous versions of SharePoint, running apps in full trusted mode would make the SharePoint server unstable which increased the maintenance costs. Although sandbox solutions existed, the restrictions applied were stringent which forced devs to run even untrusted custom code, in full-trust mode.
In SharePoint 2013, everything (which includes Lists, Libraries etc.) is an app. The JavaScript programming feature of App for SharePoint executes the custom code on a separate server e.g. Cloud, IIS, or even the client browser. This new model of SharePoint 2013 can allow access of Lists and Libraries in JavaScript using the JavaScript Object Model (JSOM). Before starting with a SharePoint App, we need to keep the following facts in mind.
- SharePoint App can be developed only on the Developer site
- The default SharePoint Administrator cannot create the SharePoint App
- The App developer must be the member of the Administrator group of the developer site.
Editorial Note: If you are absolutely new to Angular.js, check this Angular article series by Praveen that brings you up to date with Angular.
In this article, we will be using SharePoint 2013 Online and the Developer site created on it. Alternatively this application can be used in an On-Premise SharePoint application also. The prerequisites for this article is to have a basic knowledge of SharePoint 2013, especially creating Lists.
Step 1: Open the SharePoint online portal using http://portal.microsoftonline.com. Login with your subscription. (Alternatively, on-premises SharePoint 201 installation can be used). Create a new developer site and a Custom List named CategoryList as shown in the following figure:
The list will have CategoryId and CategoryName columns. Note that the default Title Column is renamed to CategoryId. The programming always uses the Title as column name.
Step 2: Open Visual Studio 2013 and create a new App for SharePoint and name it SPNG as shown in the following figure.
Set the SharePoint site for SharePoint hosted App as shown in the following figure:
Step 3: Once the app is created add the AngularJS Framework, jQuery and Bootstrap JavaScript libraries using Manage NuGet Package in the project.
Step 4: In the Scripts folder, add a new folder and name it MyScripts. In this folder, add the following JavaScript files:
Module.js
( function () { angular.module( 'spsmodule' , []); })(); |
Service.js
( function (app) { app.service( 'spsservice' , function ($q) { function manageQueryStringParameter(paramToRetrieve) { var params = document.URL.split( "?" )[1].split( "&" ); var strParams = "" ; for ( var i = 0; i < params.length; i = i + 1) { var singleParam = params[i].split( "=" ); if (singleParam[0] == paramToRetrieve) { return singleParam[1]; } } } var hostWebUrl; var appWebUrl; //The SharePoint App where the App is actualy installed hostWebUrl = decodeURIComponent(manageQueryStringParameter( 'SPHostUrl' )); //The App web where the component to be accessed by the app are deployed appWebUrl = decodeURIComponent(manageQueryStringParameter( 'SPAppWebUrl' )); //Function to read all records this .get = function () { var deferred = $q.defer(); //Get the SharePoint Context object based upon the URL var ctx = new SP.ClientContext(appWebUrl); var appCtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = appCtxSite.get_web(); //Get the Web var list = web.get_lists().getByTitle( "CategoryList" ); //Get the List var query = new SP.CamlQuery(); //The Query object. This is used to query for data in the List query.set_viewXml( '<View><RowLimit></RowLimit>10</View>' ); var items = list.getItems(query); ctx.load(list); //Retrieves the properties of a client object from the server. ctx.load(items); //Execute the Query Asynchronously ctx.executeQueryAsync( Function.createDelegate( this , function () { var itemInfo = '' ; var enumerator = items.getEnumerator(); var CategoryArray = []; while (enumerator.moveNext()) { var currentListItem = enumerator.get_current(); CategoryArray.push({ ID: currentListItem.get_item( 'ID' ), CategoryId: currentListItem.get_item( 'Title' ), CategoryName: currentListItem.get_item( 'CategoryName' ) }); } deferred.resolve(CategoryArray); }), Function.createDelegate( this , function (sender, args) { deferred.reject( 'Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }) ); return deferred.promise; }; //Function to Add the new record in the List this .add = function (Category) { var deferred = $q.defer(); //debugger; var ctx = new SP.ClientContext(appWebUrl); //Get the SharePoint Context object based upon the URL var appCtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = appCtxSite.get_web(); //Get the Site var list = web.get_lists().getByTitle( "CategoryList" ); //Get the List based upon the Title var listCreationInformation = new SP.ListItemCreationInformation(); //Object for creating Item in the List ctx.load(list); var listItem = list.addItem(listCreationInformation); listItem.set_item( "Title" , Category.CategoryId); listItem.set_item( "CategoryName" , Category.CategoryName); listItem.update(); //Update the List Item ctx.load(listItem); //Execute the batch Asynchronously ctx.executeQueryAsync( Function.createDelegate( this , function () { var Categories = []; var id = listItem.get_id(); Categories.push({ ID: listItem.get_item( 'ID' ), CategoryId: listItem.get_item( 'Title' ), CategoryName: listItem.get_item( 'CategoryName' ) }); deferred.resolve(Categories); }), Function.createDelegate( this , function () { deferred.reject( 'Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }) ); return deferred.promise; } //Method to Update update the record this .update = function (Category) { var deferred = $q.defer(); var ctx = new SP.ClientContext(appWebUrl); var appCtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = appCtxSite.get_web(); var list = web.get_lists().getByTitle( "CategoryList" ); ctx.load(list); listItemToUpdate = list.getItemById(Category.ID); ctx.load(listItemToUpdate); listItemToUpdate.set_item( 'CategoryName' , Category.CategoryName); listItemToUpdate.update(); ctx.executeQueryAsync( Function.createDelegate( this , function () { var Categories = []; var id = listItemToUpdate.get_id(); Categories.push({ ID: listItemToUpdate.get_item( 'ID' ), CategoryId: listItemToUpdate.get_item( 'Title' ), CategoryName: listItemToUpdate.get_item( 'CategoryName' ) }); deferred.resolve(Categories); }), Function.createDelegate( this , function () { deferred.reject( 'Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }) ); return deferred.promise; }; }); }(angular.module( 'spsmodule' ))); |
- This code has a dependency on $q. This service helps the functions to run asynchronously and use their return values when the processing is completed. In the above code, all functions uses the $q.defer() function. This is used to declare the deferred object, which helps us in building an asynchronous function.
- The code uses the hostWebUrl and appWebUrl which represents the URL for sharepoint app where the app will be installed, and the URL from where components required for the app can be accessed respectively.
- The function get(), add() and update() is passed with $scope object which is used to update the $scope objects declared in the controller. These objects are further bound with the UI.
- All functions in the above code get a reference of the SharePoint context object using SP.ClientContext ().
- All functions in the above code perform execute operations using executeQueryAsync () method of the SharePoint context objects.
- The get() function is used to read all data from the CategoryList and store data in the Categories array.
- The add() is used to add a new record in the CategoryList. This uses the Category $scope object passed from the controller to the add () function.
- The update() function is used to update the record from the CategoryList using the Category $scope object passed from the controller to the update () function.
( function (app) { app.controller( 'spscontroller' , function ($scope,spsservice) { load(); $scope.Categories = []; $scope.Category = { ID:0, CategoryId: "" , CategoryName: "" }; var IsUpdate = false ; //Function to load all categories function load() { var promiseGet = spsservice.get(); promiseGet.then( function (resp) { $scope.Categories = resp; }, function (err) { $scope.Message = "Error " + err.status; }); } //Function to load the selected record $scope.loadRecord = function (cat,$event) { $event.preventDefault(); $scope.Category.ID = cat.ID; $scope.Category.CategoryId = cat.CategoryId; $scope.Category.CategoryName = cat.CategoryName; IsUpdate = true ; } //Function to Create a new category or update existing base on the //IdUpdate boolean $scope.save = function ($event) { $event.preventDefault(); if (!IsUpdate) { var promiseSave = spsservice.add($scope.Category); promiseSave.then( function (resp) { alert( "Saved" ); }, function (err) { $scope.Message = "Error " + err.status; }); } else { var promiseUpdate = spsservice.update($scope.Category); promiseUpdate.then( function (resp) { alert( "Saved" ); }, function (err) { $scope.Message = "Error " + err.status; }); IsUpdate = false ; } } }); }(angular.module( 'spsmodule' ))); |
- This controller class uses the $scope object and the spsservice Angular service.
- Declares Categories array and Category object. These will be used for DataBinding on UI.
- The load() function calls the get () function of the service. This receives the promise object which represents the result when the asynchronous call is completed from the service.
- loadRecord() is used to display the selected category from the table on the UI.
- The save() function is used to either create a new record in the list or update the existing one based on the IsUpdate Boolean object.
Step 5: Open Default.aspx and add the following script references:
< script src = "../Scripts/jquery-2.1.3.min.js" ></ script > < script src = "../Scripts/bootstrap.min.js" ></ script > < script src = "../Scripts/angular.min.js" ></ script > < script src = "../Scripts/angular-ui/ui-bootstrap-tpls.min.js" ></ script > < script src = "../Scripts/MyScripts/module.js" ></ script > < script src = "../Scripts/MyScripts/service.js" ></ script > < script src = "../Scripts/MyScripts/controller.js" ></ script > < link href = "../Content/bootstrap-theme.min.css" rel = "stylesheet" /> < link href = "../Content/bootstrap.min.css" rel = "stylesheet" /> |
Step 6: Add the following markup in the PlaceHolderMain of Default.aspx
< div ng-app = "spsmodule" > < div ng-controller = "spscontroller" > < hr /> < br /> < div id = "dvdml" > < table class = "table table-condensed table-striped table-bordered" > < tr > < td >Category Id:</ td > < td > < input type = "text" class = "form-control" ng-model = "Category.CategoryId" /> </ td > </ tr > < tr > < td >Category Name:</ td > < td > < input type = "text" class = "form-control" ng-model = "Category.CategoryName" > </ td > </ tr > </ table > </ div > < input type = "button" id = "btnaddcategory" class = "btn btn-small btn-primary" value = "Save" ng-click = "save($event)" /> < br /> < table class = "table table-bordered table-striped" > < thead > < tr > < th class = "c1" >RecordId</ th > < th class = "c1" >CategoryId</ th > < th class = "c1" >CategoryName</ th > < th class = "c1" ></ th > < th class = "c1" ></ th > </ tr > </ thead > < tbody > < tr ng-repeat = "Cat in Categories|orderBy:'CategoryId'" > < td >{{Cat.ID}}</ td > < td >{{Cat.CategoryId}}</ td > < td >{{Cat.CategoryName}}</ td > < td > < button class = "btn glyphicon glyphicon-pencil" ng-click = "loadRecord(Cat,$event)" /> </ td > </ tr > </ tbody > </ table > </ div > </ div > |
Step 7: Since we need to perform a Read/Write operations on the List using App, we need to apply access rights. In the project we have an AppManifest.xml. This is used to set the App permissions. Double-Click on this file and set the permissions as shown in the following figure:
Here we need to set permissions on the Web Sire and the List, so that we can perform Read/Write operations.
Run the application, after deployment we can set the trust for the app as shown here:
Click on Trust It and the following result will be displayed:
Enter Category Details in the textboxes and click on the Save button, the new category record added in the table will be displayed as shown in the following figure:
Conclusion: The SharePoint App Model can be developed effectively using a client-side library like Angular.js. The abstractions provided by Angular fit very well into the SharePoint ecosystem and hence we can develop rich interfaces using this combination. The abstractions also help us in keeping the code base pretty clean.
Download the entire source code of this article (Github)
Subscribe to:
Posts (Atom)