Friday, 8 June 2012

How to override lookup


void SummaryProjectLookup(FormControl ctrl)
{
    SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(ProjTable),ctrl);
    Query query = New Query();
    QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(ProjTable));
    QueryBuildRange queryBuildRange;
    ;

    sysTableLookup.addLookupfield(fieldNum(ProjTable, ProjId));
    sysTableLookup.addLookupfield(fieldNum(ProjTable, Name));
    sysTableLookup.addLookupfield(fieldNum(ProjTable, Status));

    queryBuildRange = queryBuildDataSource.addRange(fieldNum(ProjTable, Type));
    queryBuildRange.value(queryValue(ProjType::Summary));
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}

public void lookup()
{
    element.SummaryProjectLookup(this);
}


Copied from Experts website....... Dynamicsaxtraining.
You can always reach me at axapta4all@gmail.com
Anonymous Axaptian  

2 comments:

  1. Your blog is really awesome and I got some useful information from your blog. This is really useful for me. Thanks for sharing such a informative blog. Keep posting.
    Microsoft Dynamics CRM Online Training | Dynamics AX Online Training

    ReplyDelete