0

I have a List that takes long time on Item.Update(). Even Its added an Item to the list it waits few minutes to completed the Task.

Here what I have tried to troubleshoot.

  1. Created Template and tried with 0 Items.
  2. Removed workflows & Infopath forms associated.
  3. Check ULS Logs

Could somebody give any Idea what is wrong here. Below Image is for your reference with Timespan

enter image description here

$List=$spWeb.Lists["MIC GatePass-3"] 
write-host "sd" $List
$List.ItemCount
$item= $List.AddItem()
$item["Title"]="Item1";
 Get-Date
write-host "Adding..."
$item.Update();
write-host "Done..."
Get-Date
7
  • Is there any custom event added that is causing this delay ?
    – Saira
    Sep 6, 2021 at 23:58
  • @Saira No custom event Receivers.
    – mzonerz
    Sep 7, 2021 at 4:38
  • Please check if the delay is same for other list , if you find the same delay try checking this on new site with new list.
    – Saira
    Sep 8, 2021 at 4:30
  • @Saira No its not for other lists.
    – mzonerz
    Sep 8, 2021 at 11:48
  • That means there is something , any event or any delay for sure attached to this list
    – Saira
    Sep 9, 2021 at 22:27

1 Answer 1

0

The call to $item.Update(); actually triggers an event ItemAdded (the initial .AddItem does not do anything in the DB until the first .Update). I suspect you have a very slow ItemAdded Event Receiver (ER) attached to the list. That's the thing to check first.
However, both your ItemAdded and/or your ItemUpdated ER can be the cause of the delay if they are registered as synced events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.