Rename without trigger

I’m attempting to write in a CU to rename a record as a part of the primary key of a table. In the OnRename of the table is code that I would not like to execute. Unlike the MODIFY function, the RENAME function does not give you the option to supress running the trigger. Do any ways exist to use the RENAME function and not run the OnRename trigger.

Torolf, I don’t know a way to supress the OnRename trigger, but you could think of a little workaroud… create a new function within that table that simply set a variable to True, e.g. SkipOnRename := TRUE. In the OnRename trigger you place - IF SkipOnRename then EXIT… Not really usefull for a lot of tables, but helps in specific cases. Saludos Nils

Navision use the same process as Nilsm suggests i.e. in Sales Header Table Navision use show/Hide the popup forms.

Thanks, sounds like a good idea.

Hi, I found the Rename() function to be annoying the fact, (1) Cann’t use setrange and Repeat…Until to rename a set of records (2) Time consumed to rename looks to be more… I better say…go for a temp record variable swap the record to temp…delete the record and transferfields… just change the fields u wanna change… and insert… it looks simple to use it though… and fast too… cheers, JHC[:D]

Hi Chandar, re. (1): Yes you can. Use can either use a different variable than the one used in the REPEAT loop-variable to do the rename OR use a secondary key (not using the primary key-fields) in the REPEAT loop. re. (2): The Rename function is timeconsuming because it ensures dataintegrity, i.e. renames every occurrence of the field in the database which relates to it (and ValidateTableRelation = Yes). Your suggestion, on the other hand, ignores dataintegrity entirely and could potentially do a lot of damage. Search the forum and you’ll find a lot of advice re. speeding up the RENAME process.

Steffen, Thank you for posting exactly what I thought of writing but felt too tired to do. [xx(] I’m 100% behind you on this.