How to Check if a Line has changed within a Header Table

SMGNavSMGNav Posts: 2Member
Hello there! I am new to Nav and would appreciate some help here.

So, I have a HEADER Table with a boolean - "Record Modified"
This field is non editable and changes based on printing a report.
If a record is modified after printing a report the box is checked.
I have this working by setting the boolean to true in the Header Table OnModify() function.

This Header Table also has a Line table and I'm trying to set this boolean to TRUE if a record in the LINE table is changed.
I have tried putting this code in the Line table OnModify():

HeaderTableRec.GET( No. )
HeaderTableRec."Record Modified" := TRUE
HeaderTableRec.MODIFY

but the check box does not change. I'm not sure if I'm missing how the tables are related or I'm referencing the Header table the wrong way

Best Answer

Answers

  • sjensjen Posts: 34Member
    Since it is working on your header why can't you write something in your line table like
    IF HeaderTableRec."Record Modified" = TRUE THEN
      "Record Modified" = TRUE;
    
  • vaprogvaprog Posts: 927Member
    Hi SMGNav

    Your code looks correct. Make sure the OnModify trigger of the line is actually called.
  • SMGNavSMGNav Posts: 2Member
    Thank you for your replies! I was missing a key as Resolus suggested.
Sign In or Register to comment.