SETFILTER on OnOpenForm

gulamdastagir
gulamdastagir Member Posts: 411
hello navies

i have a table with two fields X,Y part of the primary key.

On the Form_OnOpenForm Trigger

SETFILTER(X,filter)

and on the ONInsert trigger of the corresponding table

Y=Numberseries.INIITSERIES(i.e populating the Y field)

Result is i find both X and Y fields are both populated. e.g

X Y
C123 BIN123
I understand it works for Y but how does it work for X when all i did was a SETFILTER(X,filter)

Thanks for taking the time to read and if possible reply

Cheers
Regards,

GD

Comments

  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    This is the NAV feature.

    If you set a filter on the field which is in Primary Key then when you insert a new record on the form the values from the filter are populated to the filtered field(s).

    This will work if the filter is 'simple'. If your 'filter' variable was equal to 'C123|C123' you wouldn't get anything set on X.

    Regards,
    Slawek.
    Slawek Guzek - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;
  • gulamdastagir
    gulamdastagir Member Posts: 411
    This is the NAV feature.
    thanks for confirming that slawek
    Regards,

    GD