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 AX (Archived)

How to delete approved timesheet

(0) ShareShare
ReportReport
Posted on by

I am using AX2012 R2 CU7

I have some timesheets that can't be posted due to dimension error, yet it can't be re-submitted or deleted from the front end. It's just staying there on the system. I am using auto approval for testing purposes. Is there anyway I can delete the timesheet from the front end or anybody can share with me the code and how to delete the timesheet from backend, help is appreciated.

There is similar post on this, but no solution so far. Thanks.

*This post is locked for comments

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

    Hi!

    Verify this query: DELETE TSTIMESHEETTABLE WHERE TIMESHEETNBR = 'timesheet number' AND DATAAREAID = 'company id code'

    Regards,

    Pablo

  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    To be able to delete timesheets, the status needs to be reset first. You have to do this for the TSTimesheetTable record as well as the related TSTimesheetLine records. Then you can delete the timesheets. Do this from within AX (not SQL directly) as there are some cascading delete actions which will also delete related records in other tables.

  • Community Member Profile Picture
    on at

    Thanks Pablo and André

    How do I reset the status within AX? The time sheet is already stuck on the status "approved", it can't be rejected, can't be posted (certain lines doesn't have dimension), can't be deleted as well. Thanks.

  • Community Member Profile Picture
    on at

    Hi!

    Can you add the financial dimensions? Open the timesheet and go to details, add the missing financial dimensions and try to submit it again. Please keep us posted.

    Thanks,

    Pablo

  • Community Member Profile Picture
    on at

    Hi Pablo,

    Any "approved" timesheet can only be viewed, even the approver cant reject it again  it can't be edited anymore, that's why I have to resort to deleting it.

    I have 2 things in mind:

    - key in the line financial dimensions from sql, but I don't know where it is stored and how to insert data to it. Thanks.

    - Reset the status from sql for the timesheet to "draft" for header and its line, but I don't know how many cascading table involved and how to to do so, thanks.

    Jack

  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Jack,

    From within the development workspace (AOT) you can browse for the tables mentioned above. Open the table browser, find the record(s) and you can change the status back to new or draft. Don't set the status to 'all'. Then you are able to make changes in the details like the dimensions or delete them.

    Be careful with this kind of editing data... it's too easy to change the wrong records or fields.

  • Community Member Profile Picture
    on at

    Hi André,

    Thanks for the advice

    but can't just open TStimesheet Table and edit the record

    end up using X++ code to modify the record

    created another thread and coding issue has been resolved as well

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans