vendredi 10 juin 2011

How to add filter to the dataSource of a form

set a relation between a DataSource  and Table for example relation between VendTable and smmBusRelSectorTable in smmBusRelSectorTable Table , set the validate proprety to no. Add smmBusRelSectorTable to your the DataSource of your form and set the appropriate LinkType proprety for example : ExistJoin

then,in the prompt method of the VendTable dataSource of your form :

public void prompt()
{
    QueryBuildDataSource  qbds;

    QueryBuildDataSource  qbdsAdd;

    Query                   Query;

    queryrun                qr;

    ;

    query = new Query();

    qbds = query.addDataSource(tablenum(VendTable));

    qbdsAdd = qbds.addDataSource(tablenum(smmbusrelsectortable));

    qbdsAdd.relations(true);

    qr = new sysqueryrun(query);

    this.queryRun(qr);

    super();
}

Happy Daxing!

Aucun commentaire:

Enregistrer un commentaire