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

Mohammad Qasim 576 Reputation points
2021-04-14T11:05:38.93+00:00

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

87773-deletedquery.png
87736-insertmethof.png

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
    2021-04-15T04:25:09.487+00:00

    Hi @Mohammad Qasim ,

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

    88026-image.png


    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.