Best process to delete company

vijay_gvijay_g Member Posts: 884
edited 2010-06-25 in Navision Financials
hi,
Is there any difference anyhow to delete a compnay(in both case SQL and Native) from company Talbe
or delete from file---compnay--delete.

Comments

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I would always go for File -> Company -> Delete. I never heard of deleting a record in the Company table could also be possible. And when you take a look at the OnDelete-Trigger of the Company table there is no code within it. Thus I would think these two things can't be the same.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • vijay_gvijay_g Member Posts: 884
    i think so, but when i am deleting from company the counter has prompt in proces saying like Deleting Record.....
    and also taking time same to delete from file menu.
  • krikikriki Member, Moderator Posts: 9,115
    vijay_g wrote:
    i think so, but when i am deleting from company the counter has prompt in proces saying like Deleting Record.....
    and also taking time same to delete from file menu.
    Deleting the record in the Company-table DOES work. I also used it a few times.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Who'd have thunk? I never tried it but when you say so... amazing!

    Why is there a special right (System, 1640) to it, when you are able to do with this workaround? Or do they correspond to each other? If not, I think you have to be careful with the user rights because in many cases users are assigned to a role like SUPER (DATA).
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I would always go for File -> Company -> Delete. I never heard of deleting a record in the Company table could also be possible. And when you take a look at the OnDelete-Trigger of the Company table there is no code within it. Thus I would think these two things can't be the same.

    I have always deleted and renamed companies from the company table in object designer. It started the first time I used Financials, and I never actually knew about the menu option till many years later I was at a client and we did some testing in a Cronus company the client then renamed using the menu option, and also showed me the delete option. I don't think there is any difference, but if anyone knows different it would be interesting to know.
    David Singleton
  • Edward_BloomfieldEdward_Bloomfield Member Posts: 155
    I would discourage the deletion of companies directly through the Company Table. If you do this, you are only challenged by NAV once before it deletes the company - If you do it via File -> Company -> Delete, then NAV challenges you twice.

    The following is also worth knowing:

    I did know of one client a long time ago who was updating their NAV security in the user roles screen by adding Companies to the Company field of the role but put the wrong company in, but instead of clearing and re-entering, they drilled down and pressed F4 instead... bye bye Company... So back to last night's back up for them...
    Edward Bloomfield

    Lead Consultant
    Theta
  • vijay_missvijay_miss Member Posts: 10
    Deleting Company from File - Company menu is a normal way, it will search for all the data in database related to company what you are going to delete.
    But if you delete it directly from Object designer it will just delete information from a particular table but all date will still there in the database.

    Regards,
    Vijay Mishra
  • David_SingletonDavid_Singleton Member Posts: 5,479
    vijay_miss wrote:
    But if you delete it directly from Object designer it will just delete information from a particular table but all date will still there in the database.

    :shock: HUH since when?
    David Singleton
  • vijay_gvijay_g Member Posts: 884
    vijay_miss wrote:
    Deleting Company from File - Company menu is a normal way, it will search for all the data in database related to company what you are going to delete.
    But if you delete it directly from Object designer it will just delete information from a particular table but all date will still there in the database.

    Regards,
    Vijay Mishra

    Then you mean if i delete company from object designer with copying comp name and after that paste(ctrl+v) to same in table then data should not be lost.
    i have done it at all but don't able to recover data so how can we get data?
  • krikikriki Member, Moderator Posts: 9,115
    vijay_miss wrote:
    Deleting Company from File - Company menu is a normal way, it will search for all the data in database related to company what you are going to delete.
    But if you delete it directly from Object designer it will just delete information from a particular table but all date will still there in the database.

    Regards,
    Vijay Mishra
    I don't think it this is correct.
    When you delete the record from table "Company", NAV goes through the whole process deleting all objects (and tables and data...).
    If you have full recovery model on your SQL DB (and you transactionlog backups are functioning!), you can still get your data back by doing a point-in-time restore.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • vijay_missvijay_miss Member Posts: 10
    Yes You are right.

    Actually I misunderstand the table name. I thought they are talking about Company Information Table.

    I am sorry because I always prefer to delete it through File- Company - Delete.

    anyway it is working but I am still not convinced to delete the company directly from the Object Designer if there is a proper way for that.

    We can erase so many things directly from database without writing codes etc. but we should always follow proper channel to avoid future problems especially if we are on live database.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    vijay_miss wrote:
    We can erase so many things directly from database without writing codes etc. but we should always follow proper channel to avoid future problems especially if we are on live database.


    =D> Yes this is the best attitude to take.
    David Singleton
  • hansikahansika Member Posts: 373
    vijay_miss wrote:
    we should always follow proper channel to avoid future problems especially if we are on live database.

    Could you explain some proper ways ?

    Thanks in advance.
    hansika
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I guess the official way by File -> Company -> Delete is meant.

    And I tested my question about user rights. You can deny access to this menu item (System, 1640) but the user is still able delete or rename a company by table access. Same thing for the tables User, Member Of, User Role, Permission,... I guess that means you have to be very careful to whom you can assign a role like SUPER (DATA).
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.