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

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Bulk deletion of unposted production journal entries

(1) ShareShare
ReportReport
Posted on by 2
Hello,
Due to an integration error handling mistake which was not observed for many months we ended up having a lot of unposted reported as finished journals against a specific production batch order. The specific quantity that exceeded the production ordered quantity is around 300,000 and the manual deletion processes is taking ages. We used the system default classes that allow deletion of the lines in these journals and created our own class but still it too is taking a lot of time. Current average is 1 quantity per one minute. It can be imagined that it will take months to delete complete records and till then we are stuck with this production.
 
Is there any other way to delete unposted RAF journals which could be rapid and precise so that there are no issues to related modules such as inventory.
 
Any help with code or procedure will be highly appreciated. 
 
Categories:
I have the same question (0)
  • Suggested answer
    Sahan Hasitha Profile Picture
    694 on at
    Bulk deletion of unposted production journal entries
    hi
     
     â€¢  Use a Processing-Only Report (AL customization)
        Build a processing-only report that loops through the unposted RAF journals and deletes them in bulk.
        Instead of calling Rec.Delete(true) (which triggers validations), you can use Rec.Delete(false) or DeleteAll() on filtered records to skip triggers.
        This makes deletion much faster, but you must ensure data integrity manually afterward.
    •  Filter Narrowly Before Deleting
        Filter on specific:
        Production Order No.
            Journal Template / Batch
        This way, you delete in manageable chunks (e.g., 10,000 per run) rather than hammering the whole 300,000 at once.
     
  • Suggested answer
    CA Neeraj Kumar Profile Picture
    1,071 on at
    Bulk deletion of unposted production journal entries
    Hi,
     
    Since you require this activity to be done once, it can be done manually as well but some important tips to follow:
    1) Navigate to Production Control > Adjustments > Reports as finished.
    2) Prepare the list of RAFs in excel first, and identify how to filter those like RAF001, RAF002, RAF003, RAF004 etc,.. can be filtered with some criteria like RAF001..RAF003.
    3) Filter by relevant criteria like 5000 records around should come in one page.
    4) Select all at once and click on delete button.
    5) Duplicate the tab to create the new session, perform same activity. 
     
    Assume you have already opened 10 tabs, 50000 records will be parallely deleting. This way you will be able to delete it faster. As of now, clean up job i saw was for deleting posted journal, if i find something around it, will let you know.
     
    Regards,
    Neeraj Kumar
     

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 213

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 123

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 100 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans