Sunday, 16 December 2018

Duplicate Event Recivers SharePoint 2013 Site Collection Level (Site Feature)


Issue Description:- SharePoint custom event receivers triggered twice. On folder creation custom event receiver triggered (On Item updating and On Item Updated) to perform set of task in folder level but due to twice event triggered our functionally break. After investigation, we found that duplicate event receiver entry present in site collection database table – [EventReceivers].



Resolution:-  Remove the duplicate entry from Site Collection database entry. Please find the below steps to remove the duplicate entry from database table.

  • Disable the feature   (Disable-SPFeature -Identity XXXXX -url http"//xxx/sites/xxx )

  • Find out the custom event receivers id from site collection level.

$siteEventID = Get-SPSite http"//xxx/sites/xxx

$siteEventID.EventReceivers | Select Id, Name

  • Delete event id from site collection level.

$site = Get-SPSite http"//xxx/sites/xxx

$event_updating =$site.EventReceivers | ?{$_.ID -eq "xxxxx"}

$event_updated =$site.EventReceivers | ?{$_.ID -eq "xxxxx"}

$event_updating.Delete()

$event_updated.Delete()

  • Enable the feature (Enable-SPFeature -Identity XXXXX -url http"//xxx/sites/xxx )

Thursday, 30 August 2018

SharePoint Timer jobs check


SharePoint Timer service was started in services.msc, the timer service instance object (this is a SharePoint farm object) may be set to “Disabled”. Use below script to get the status of all the timer instances in the farm.
---------------------------------------------------------------------------
 $farm = Get-SPFarm
 $FarmTimers = $farm.TimerService.Instances
 foreach ($FT in $FarmTimers)
 {
 write-host "Server: " $FT.Server.Name.ToString();
 write-host "Status: " $FT.status;
 write-host "Allow Service Jobs: " $FT.AllowServiceJobs;
 write-host "Allow Content DB Jobs: " $FT.AllowContentDatabaseJobs;"`n"
 }
 $disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
 if ($disabledTimers -ne $null)
 {
 foreach ($timer in $disabledTimers)
 {
 Write-Host -ForegroundColor Red "Timer service instance on server " $timer.Server.Name " is NOT Online. Current status:" $timer.Status
 Write-Host -ForegroundColor Green "Attempting to set the status of the service instance to online..."
 $timer.Provision()
 $timer.Start()
 write-host -ForegroundColor Red "You MUST now go restart the SharePoint timer service on server " $FT.Server.Name}}
 else
 {
 Write-Host -ForegroundColor Green "All Timer Service Instances in the farm are online. No problems found!"
 }


Sunday, 1 July 2018

SharePoint 2016 & Office 365 - Framework - Part-1

Set up your SharePoint Framework development environment 

SharePoint Framework Reference:- 

Thursday, 17 May 2018

O365 - Nintex Workflow + SharePoint Create Folder + Call HTTP web service + REST API

Working with folders by using REST
You can retrieve a folder inside a document library when you know its URL
The following example shows how to create a folder.
url: http://site url/_api/web/folders
method: POST
body: { '__metadata': { 'type': 'SP.Folder' }, 'ServerRelativeUrl': '/document library relative url/folder name'}
Headers:
    Authorization: "Bearer " + accessToken
    X-RequestDigest: form digest value
    accept: "application/json;odata=verbose"
    content-type: "application/json;odata=verbose"
    content-length:length of post body


For Nintex - Call HTTP web service + REST API

Address: site_URL_api/web/getfolderserverrelativeurl('Share%Document')/folders/add(NewFolder')
Request Type : HTTP Post
Request Headers: "accept: "application/json;odata=verbose"
    content-type: "application/json;odata=verbose""




O365 - Call HTTP Web Service failed - Unauthorized "Access denied"

When using the "Call HTTP Web Service" action - Receive the following error:
 Unauthorized - {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message": 
{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}

Register Workflow App ID  into destination location with Full Control.

Please follow the below steps to resolve the issue:


Friday, 11 May 2018

Nintex Forms JS Events


Event Type
How to add a handler to this event
Filler Before Ready
  1. NWF.FormFiller.Events.RegisterBeforeReady(function ()
{ // your custom code goes here });
Filler After Ready
  1. NWF.FormFiller.Events.RegisterAfterReady(function ()
{ // your custom code goes here });
Repeater Row Adding
  1. NWF.FormFiller.Events.RegisterRepeaterRowAdding (function ()
{ // your custom code goes here });
Repeater Row Added
  1. NWF.FormFiller.Events.RegisterRepeaterRowAdded (function ()
{ // your custom code goes here });
Repeater Row Deleting
  1. NWF.FormFiller.Events.RegisterRepeaterRowDeleting (function ()
{ // your custom code goes here });
Repeater Row Deleted
  1. NWF.FormFiller.Events.RegisterRepeaterRowDeleted (function ()
{ // your custom code goes here });
Control Resizing
  1. NWF.FormFiller.Events.RegisterControlProcessing (function ()
{ // your custom code goes here });
Control Resized
  1. NWF.FormFiller.Events.RegisterControlProcessed (function ()
{ // your custom code goes here });

Thursday, 10 May 2018

SharePint Workflow Status Code


Workflow Status Codes

Number
Member name
Description
0
NotStarted
The workflow has not started.
1
FailedOnStart
Indicates that the workflow encountered an error when it started.
2
InProgress
Workflow is currently in progress.
3
ErrorOccurred
An error occurred during the execution of the workflow.
4
StoppedByUser
Workflow execution was halted by a specified user.
5
Completed
The workflow is completed.
6
FailedOnStartRetrying
Indicates that the workflow is being retried after it failed to start.
7
ErrorOccurredRetrying
Indicates that the workflow is being retried after an initial failure.
8
ViewQueryOverflow
This member is reserved for internal use and is not intended to be used directly from your code.
15
Max
This member is reserved for internal use and is not intended to be used directly from your code.

 Workflow History List Event Types

Number
Event Type
Description
0
None
There is no specific event type for this workflow event.
1
WorkflowStarted
The workflow event concerns the workflow instance being initiated.
2
WorkflowCompleted
The workflow event concerns the workflow instance being completed.
3
WorkflowCancelled
The workflow event concerns the workflow instance being cancelled.
4
WorkflowDeleted
The workflow event concerns the workflow instance being deleted.
5
TaskCreated
The workflow event concerns a workflow task being created.
6
TaskCompleted
The workflow event concerns a workflow task being marked as complete.
7
TaskModified
The workflow event concerns a workflow task being modified.
8
TaskRolledBack
The workflow event concerns changes to a workflow task being rolled back.
9
TaskDeleted
The workflow event concerns a workflow task being deleted.
10
WorkflowError
The workflow event concerns the workflow instance generating an error.
11
WorkflowComment
The workflow event concerns a comment being written for the workflow instance.