Renaming a Company in C/AL

Does anyone know how to emulate the Company Rename function available from the File Dropdown Menu in C/AL code? [We are using version 3.60]

Hi, You cannot emulate the company rename function because all the objects have to be renamed internally in order to placed under the new company which is part of Navision executable. Thanks Best regards Suresh.

Hi, Yes you can. Company.GET(‘Company Name’); IF Company.Name = COMPANYNAME THEN Company.FIELDERROR(Name); Company.RENAME(‘New Company Name’); Company is a record of Company. Bjarne

It Works! Many Thanks. [I did look at the company table, but this wasn’t an obvious solution].

Take care when working with the company table, though. A DELETE or DELETEALL on this table will zap your data without warning…