Is there a way to bypass the OnRename trigger of the table while renaming the primary key of a table from a report?
I know for INSERT (also for MODIFY & DELETE) you could specifiy INSERT(FALSE) to bypass the table trigger but I couldn't find anything like that for RENAME.
Thanks for any help.
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Create also the function:
Now, just before you run the RENAME, do this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
However when running on SQL server the system runs the rename trigger a second time - and that time it is out of the context so the boolean bypass do not work.
Is this correct, and is there a way to overrule this?
- creating temp variable and copying data into it
- change (rename) fields you want to rename
- delete old item with delete(false)
- insert new item from temp variable with insert(false)
In this way, you will change (rename) the fields you want, and will not triger any of OnRename, OnInsert, OnDelete trigers.
Dynamics NAV Enthusiast
Yes, but it means that related fields will not be renamed too...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
If you want to speed up the proces of renaming, I think the fastest way is to clean up the database. Take a look at the connected tables and see in which tables you could delete some records..
Tino Ruijs
Microsoft Dynamics NAV specialist