Skip to main content
Business Central forum
Answered

How to clear data from a custom table?

editSubscribe (0) ShareShare
ReportReport
Posted on by 479

Is there a way to clear all data/rows from a table but still keeping the fields?

Categories:
  • Verified answer
    Rushiraj Suthar Profile Picture
    Rushiraj Suthar 62 on at
    RE: How to clear data from a custom table?

    Hi, 

    If you want to clear your custom table data permanently,

    then use

    TablenameVariable.DeleteAll();

    Please Verify the answer and Click on Yes if my answer will help full to you. 

    Thanks.

    Rushiraj Suthar

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 59,873 Super User on at
    RE: How to clear data from a custom table?

    Hi, I believe the following post can give you some hints.

    https://navinsights.net/2020/10/27/4-ways-to-delete-records-from-a-table/

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,714 Super User on at
    RE: How to clear data from a custom table?

    If you have a list view of them you can just mark them and delete them.

    If there is a lot of data in the table i would have my developer write some code to delete the necessary records.

  • Suggested answer
    MahGah Profile Picture
    MahGah 15,395 on at
    RE: How to clear data from a custom table?

    Test this in Sandbox first and test since this is not reversible. 

    in configuration package select that table then Export Excel. Then delete all data (except header ). Then select Delete Table Records Before Processing and upload the Excel file and apply data. 

    pastedimage1654807262289v1.png

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,030 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans