Visitors

Flag Counter

Hiding the lookup elements if the element is assigned with Another records other wise lookup will shows the all elements


public void lookup()
{
 
    Query                                           query;
    QueryBuildDataSource                qbds,qbds1;
    QueryBuildRange                         qbr;
    Sa_TableA                                    sa_TableA ; // child table having form we are insering the lookup values into child table
    Sa_TableB                                    sa_TableB  ;  // this table having the lookup :parent table:
    SysTableLookup sysTableLookup =        sysTableLookup::newParameters(tableNum(sa_TableB  ), this);

    query                         = new Query();
    qbds                          = query.addDataSource(tableNum(sa_TableB  ));
    qbds1                         =qbds.addDataSource(tableNum(sa_TableA ));
    qbds1.joinMode(JoinMode::NoExistsJoin);
    qbds1.relations(true);
    //qbds1.addLink(fieldNum(sa_TableB  ,ProjectNames),fieldnum(sa_TableA ,ProjectNames));
    qbr                           = qbds.addRange(fieldNum(sa_TableB  ,ProjectNames));
    sysTableLookup.parmQuery(query);
    sysTableLookup.addLookupfield(fieldNum(sa_TableB  , ProjectNames));
    sysTableLookup.performFormLookup();
}

No comments:

Post a Comment