how to make the process fasten

ajaybabuChajaybabuCh Member Posts: 208
Hi

I wrote one report. The report renames the primary key of all the records in a table.

report does not have any filters except the table view with primary key only.

in the OnAfterGetRecord trigger i wrote the


RENAME(value1,value2,value3); (table has 3 fields as primary key.)

i am only giving value2 as different value. value1 and value3 are the same as in the table.

But report is running tooo slow.

how can i fasten the process

Regards
Ajay
Ajay

Comments

  • jlandeenjlandeen Member Posts: 524
    The Rename operation is a very slow function, as it trolls through other tables and tries to cascade the change across to other related values. The goal of that is to preserve referential integrity, but it does take time to do that. So if you need to have Navision do preserve it for you then you may have to live with the report as is.

    If preserving relations with any other tables is not a concern then a faster to save all the records into a temporary recordset, delete the original record and then create new ones using the temporary record set. This assumes that you will manually handle any collissions of records based on their new key values.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    Hi,

    May be this solution can help to you:
    http://www.geocities.com/yagaponov/Navision/Renumbering/

    This work for MS SQL database and renumbering work via store procedure from NAV. The store procedure generate in NAV for some hand-picked table - database directory.

    If you have any questions - welcome.
Sign In or Register to comment.