How to call method , once delete method competed successfully using Jsom

Mohammad Qasim 576 Reputation points

i am using Jsom to delete mutiple items.

Poblem : once all items deleted then i want to execute insert method.

Solution Required: Just update me , where to call " insert method " , after completion of " delete operation " completed successfully. ?

Attached images are attached for code review


SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,353 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael 17,861 Reputation points

    Hi @Mohammad Qasim ,

    You should put the "insert method" in the function onDeleteSucceeded to achieve this:


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.