Mass Purge Dead Customers

otterhoundotterhound Member Posts: 16
We recently converted to Navision 4, running on SQL server. We imported all our customers from our old accounting system -- even those that had been inactive for years. We did not import any transactions for those customers.

Now I want to purge the dead customers from the Navision system. Is it safe to just run a SQL delete query on the customer table? Or are there other tables involved for a customer who has no transactions?
James D Bennett

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Never Insert/Modify/Delete data from a Navision table directly on SQL-server. You don't launch the triggers like that. Not updating flowfields, putting in data that is not according Navision-rules, ... :!: :!: :!: [-X [-X [-X

    Except if it is a NEW table creating for inserting/modifying/deleting data from SQL.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • otterhoundotterhound Member Posts: 16
    OK. Can you suggest another way to purge these customers so we don't have to do it one customer at a time?

    Thanks!
    James D Bennett
  • ara3nara3n Member Posts: 9,257
    create a new blank report
    first dataitem customer
    onaftergetrecord trigger put
    delete(true);




    run the report. Set your filters on what customers you want to delete. and printpreview.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    Or, you run the Customer table from the object designer. From there, you set the filters that you want, select the customers you want to delete and hit the delete key.
  • kinekine Member Posts: 12,562
    kriki wrote:
    Never Insert/Modify/Delete data from a Navision table directly on SQL-server. You don't launch the triggers like that. Not updating flowfields, putting in data that is not according Navision-rules, ... :!: :!: :!: [-X [-X [-X

    Except if it is a NEW table creating for inserting/modifying/deleting data from SQL.

    One small remark: If you are inserting data through direct SQL access, it will trigger Flowfield updates. 3.70 and 4.00 is using SQL triggers on tables to update the SIFT tables. This "SIFT is not updated" is only for older databases.

    But that the data are not validated and that's why can data be wrong (for example lowercase characters in code field is disaster for Navision)...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.