Changing the 'Data per company Property'

mbskapilmbskapil Member Posts: 43
Dear All
Live Database in my company is running on a company 'XXX' and i created a new company named 'YYY' .In 'XXX' company i altered the Item Master Property 'Data Per Company' to No .Now the problem i am facing is that if i made some changes in company 'YYY' then it is being effected in company 'XXX as well which i do not want to for this i want to change this property to Yes (Default) again, which i am not been able to since system is not allowing to . System is giving me this guideline to follow
*Export all records in the table to a file
*Delete all records from a table
*Modify the table Defination
*Import all the records from the table

but even this is not working as i am not ben able to delete the records in Item Master, Same is the case with Vendor Master and Customer Master

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You should have thought about this before you were doing it on a live database. That's where test- or developmentdatabases are for.

    Try commenting out all code from the OnDelete-triggers in your Item, Vendor & Customer table. Now you can delete the records (but first export them or copy them to a new table).

    Easiest thing to do is:
    1. Create a new table ItemTemp (use SaveAs when designing table Item, to copy the table structure)
    2. Create a codeunit or report to copy the records from table Item to your new table ItemTemp
    3. Create a codeunit to delete all records from table Item using recItem.DELETEALL(FALSE);
    4. Modify your table properties
    5. Same as step 2 but now from your table ItemTemp to the table Item
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • mbskapilmbskapil Member Posts: 43
    Thanks
    Luc Van Dyck
Sign In or Register to comment.