Options

Enable the boolean field based on another table's boolean field

Jacob1227Jacob1227 Member Posts: 128
Hi All,

I have two tables: I have two boolean fields in each table. If I disable(untick) the first table's boolean field, then the second table's field should enable(tick) automatically.

Example:

1)Item Variant table has 'No Variant' field
2)Item Table has 'Variant Required' field

If the No variant field in Item Variant table is disable (untick) then the Variant Required table's field Variant Required should automatically enabled(ticked).

Please guide me to do the above process.

Thanks in advance,
Jacob A.

Answers

  • Options
    lubostlubost Member Posts: 614
    1. Depending on surround functionality you can Variant Required change to Flowfield
    2. Enable and tick are different things.
  • Options
    sjensjen Member Posts: 53
    edited 2019-07-29
    Hey Jacob,
    I am pretty new to NAV so my answer might be wrong.

    If I were you I would write this code to Item Variant table, onModify trigger. Call the ITEM table, set your condition and then modify.
    ItemRec.RESET;
    ItemRec.SETRANGE(); // Your filter here
    IF ItemRec.FINDSET THEN
      REPEAT
        IF "No Variant" = FALSE THEN BEGIN
          ItemRec."Variant Required" := TRUE;
          ItemRec.MODIFY;
        END;
    UNTIL ItemRec.NEXT = 0;
    
  • Options
    RockWithNAVRockWithNAV Member Posts: 1,139
    And what did you tried so far?
Sign In or Register to comment.