OnAfterGetCurrRecord - code crashes NAV client

DamjanDamjan Member Posts: 94
Hi All,

issue: Page ID 5076 - Interaction Log Entries has some code in OnAfterGetCurrRecord where code that loads and displays comments in the FactBox Comments (linked to record of T5065 - "Interaction Log Entry") and another code in OnAfterGetCurrRecord of same page saves edited content of comments crashes the NAV client as user sorts on any column of PG5076 - "Interaction Log Entries".
There is an Add-in executed as FactBox (page Comments) is being loaded.
version: NAV 2013 R2

Code in OnAfterGetCurrRecor in PG5076 - Interaction Log Entries:
CurrPage.editPart.PAGE.SetBT(xRec."Entry No.");
CurrPage.editPart.PAGE.GetBT("Entry No.");

User steps:

1. Open NAV

2. Go to Contacts -> Page Contacts is displayed as expected

3. select any contact -> record is selected as expected

4. click on NAVIGATE -> click on button "Interaction Log Entries" ->

- Page ID 5076 - "Interaction Log Entries" is opened as expected

- record of contact interactions are loaded as expected

- FactBox "Comments" on Page ID 5076 is displayed as expected

CurrPage.editPart.PAGE.GetBT("Entry No.");
CurrPage.editPart.PAGE.SetBT(xRec."Entry No.");
runs Add-in which is handling loading and saving part of comments
-> code
CurrPage.editPart.PAGE.GetBT("Entry No.");
=> as user selects a record in PG5076 code
CurrPage.editPart.PAGE.GetBT("Entry No.") 
checks if any comments exists for that entry (record) and then loads these comments in the FactBox Comments,

-> code
CurrPage.editPart.PAGE.SetBT(xRec."Entry No.");
=> as user edits (insert, modify, delete text/content) comment code
CurrPage.editPart.PAGE.SetBT(xRec."Entry No.");
saves the comment

Issue is present if user tries to sort on any column where at least 1 entry (record) has a comment then the NAV cline freezes and NAV client crashes
Issue is not present if I remove upper code from OnAfterGetCurrRecord to OnAfterGetRecord, but then all the comments are being loaded (I know why the comments are loaded and I do not want such behaviour).

Thanks, Damjan


  • DamjanDamjan Member Posts: 94
    I found out that if Page Interaction Log Entries is not opened in full window mode, sorting on any fields works as expected (see below)

    As user maximises the page and then tries to sort on any field, the NAV client crashes.
Sign In or Register to comment.