Thursday, August 11, 2016

Start a nintex workflow using jquery ajax



Blog:

http://www.vadimtabakman.com/nintex-forms-starting-a-workflow-and-waiting.aspx

Nintex workflow service  reference

https://gamepoint.scientificgames.com/sites/COP//_vti_bin/NintexWorkflow/Workflow.asmx

http://help.nintex.com/en-US/sdks/SDK2013/#Reference/SOAP/NW_REF_SOAP_StartWorkflow.htm%3FTocPath%3DNintex%2520Software%2520Development%2520Kit%7CNintex%2520Workflow%25202013%2520Software%2520Development%2520Kit%7CNintex%2520Workflow%25202013%2520SDK%2520Reference%7CWeb%2520Service%2520Reference%7CService%2520operations%7C_____57


---------------------------------------

Note: To set setRequestHeader is very important in calling the ajax to work with the nintex workflow


function StartWorkflow(fileRef) {
var currentItemUrl=_spPageContextInfo.siteAbsoluteUrl+fileRef;

var webserUrl =_spPageContextInfo.webAbsoluteUrl+"/_vti_bin/nintexworkflow/workflow.asmx";
var soapRequest =
'<?xml version="1.0" encoding="utf-8"?>'+
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">'+
   '<soap:Header/>'+
   '<soap:Body>'+
      '<nin:TerminateWorkflowByName>'+
         '<nin:fileUrl>'+currentItemUrl+'</nin:fileUrl>'+
         '<nin:workflowName>Article Approval Workflow</nin:workflowName>'+
         '<nin:terminatePreviousInstances>0</nin:terminatePreviousInstances>'+
      '</nin:TerminateWorkflowByName>'+
   '</soap:Body>'+
'</soap:Envelope>';

$.ajax({
type: "POST",
url: webserUrl,
contentType: "text/xml",
dataType: "xml",
beforeSend: function (request)
{
 request.setRequestHeader("SOAPAction", "http://nintex.com/TerminateWorkflowByName");
},
data: soapRequest,
success: SuccessOccur,
error: ErrorOccur
});

}


function SuccessOccur(data, status, req) {
            if (status == "success")
                alert(req.responseText);
        }
        function ErrorOccur(data, status, req) {
            alert(req.responseText + " " + status);
        }

-----------------------------------------------------------

https://community.nintex.com/people/cju%40evolusys.ch

Thursday, June 23, 2016

Start or Stop workflow using JSOM


http://sharepoint.stackexchange.com/questions/174755/how-to-stop-a-sharepoint-workflow-using-jsom

http://sharepoint.stackexchange.com/questions/110937/kick-off-sharepoint-2013-workflow-using-jsom-in-app

http://sharepoint.stackexchange.com/questions/109166/error-starting-a-workflow-on-host-web-from-within-a-sharepoint-hosted-app/110970#110970

http://sharepoint.stackexchange.com/questions/159432/programmatically-create-workflow-with-javascript-jsom-and-sp-workflowservices-w

http://www.vrdmn.com/2014/08/start-sharepoint-2013-workflows-with.html

http://www.codeproject.com/Articles/607127/Using-SharePoint-Workflow-Services-JS-API

Wednesday, May 25, 2016

Good sharepoint blog



http://www.c-sharpcorner.com/members/vijai-anand-ramalingam/articles-8

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)