Code in OnAfterGetCurrRecord crashes the NAV client

Hi All,

Please can I get some ideas on below issue.

version: NAV 2013 R2
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 some Add-in executed as FactBox (page Comments) is being loaded.

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

  • the code in PG5076 - OnAfterGetCurrRecord runs below code:
CurrPage.editPart.PAGE.SetBT(xRec."Entry No.");
CurrPage.editPart.PAGE.GetBT("Entry No.");
  • as user selects a record in PG5076 code checks if any comments exists for that entry (record) and then loads these comments in the FactBox Comments,

  • as user edits (insert, modify, delete text/content) comment second line of code saves the comment

  • procedure SetBT and GetBT runs Add-in which is handling loading and saving part of comments

  1. User clicks on any column of PG5076 to sort records from ASC or DESC (by the column user clicked on)
  • if there are no comments for any entry (record) of PG5076 everything works as expected
  • user can filter on any column of PG5076 and NAV client does not crash, but works as expected
  • if there is any comment on an entry it is being loaded as user selects that entry (record) - Column Comment is set to YES if any comment exists
  • if user edits loaded comment, the content of comment is save as user selects another record or closes the page (CurrPage.editPart.PAGE.SetBT(xRec.“Entry No.”):wink:

  • 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 PG5076 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 for any suggestions.