web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to delete (waiting) bulk delete jobs using c# plugin - Dynamics365 (on-prem).

(0) ShareShare
ReportReport
Posted on by

Hi All,

I need to delete unwanted bulk delete jobs(which is in waiting state) in dynamics365-on prem. Since I can delete only cancelled jobs. I am trying to change statuscode of bulk delete jobs from "waiting" to "canceled" using c#. 

Below screenshot shows my code.

QueryExpression_5F00_tocancelsysjob.PNG

Above code gets executed without any error but status code update is not happening. Please let me know the way to delete / cancel bulk delete jobs using c# plugin.

Thanks in advance.

Regards,

Swathi.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Any of you aware of this issue ??

  • Suggested answer
    Kishor Kumar Profile Picture
    3,710 on at

    When you debug are you able to see the status change Swati? the Status Codes?

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Swathi,

    This code will only update the status for the first record retrieved by Query Expression. For all the other records, it will fail. To update all the records, you should loop through all the records.

    Can you please paste the code as such instead of giving a screenshot?

  • Community Member Profile Picture
    on at

    Hi Kishor,

    Thanks for your reply.

    I have tried to retrieve and see the value post update. But values are not changed. Here is my screenshot for your reference.

    state.PNG 

  • Community Member Profile Picture
    on at

    Hi Nithya..

    Thanks for your reply. I can understand your point but, I am trying to update a single record first. after successful attempt will loop through all records.

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Swathi,

    Why should you retrieve the entity twice? One using query expression and the other using retrieve by ID.

  • Community Member Profile Picture
    on at

    Hi Nithya,

    Thanks for your time.

    As you suggested. I have changed my code as below. It worked. I am able to change the status as canceled

    Job.PNG

    Regards,

    Swathi.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans