Subject Re: on_navigate with mastersource and masterfields why diffrence
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 10 May 2024 17:42:55 +0200
Newsgroups dbase.getting-started

On 2024/05/09 23:16, Dirk C wrote:
> hello to you,
>
> a explanation needed
>
>   when i use this query with masterfields, rowset_onnavigate is working
>
>   well
>
>   but if i use mastersource the rowset onnavigate is following aswell but!
>
> only one step later,


I can see what is happening and the work-around is to add a requery for
VRAAGBAK_AFMETING in the onNavigate event handler.

function rowset_onNavigate1(type, nRows)  // vraagbak_crossen
   this.parent.parent.vraagbak_afmeting.requery()
   if
empty(this.parent.parent.vraagbak_afmeting.rowset.fields["afmvolgnr"].value)
     this.parent.parent.DOOS_AFMETING.KNOP_AFMETING_INGAVE.visible = true
      ?"test true"
   else
    this.parent.parent.DOOS_AFMETING.KNOP_AFMETING_INGAVE.visible = false
      ? "test false"
    endif
    return

It does, however, look as if you are doing something that is most
unusual.  Mastersource is usually used to fetch many records from the
child table where a field in the child table contains the same value as
the value in a single record of the parent table.

Even though there may be many matching records in the child table, your
onNavigate event handler for the parent query will only ever look at the
first of possibly many child records.

Mervyn.