Thursday, 17 October 2013

How to get Multiple Select Lookup in form


How  to get Multiple Select Lookup in form :

Class Declaration of Form :
SysLookupMultiSelectCtrl msCtrl;
In  Data Source Execute query :
#define.seperator(', ')
    container c,v;
    int i;
    boolean first;
    Name allPackIds;
 
  v = msCtrl.getSelectedFieldValues();
 
        first = true;
        for (i = 1; i <= conLen(v);i++)
        {
             if(first)
                {
                    first = false;
                    allPackIds = conPeek(v,i);
                }
            else
                allPackIds += ( #seperator + conPeek(v,i));
        }
 
   if(Amenities.valueStr())
        qbrAmenities.value(allPackIds);
    else
    {
       qbrAmenities.value(SysQuery::valueUnlimited());
    }
 
 
Init of Form :
msCtrl = SysLookupMultiSelectCtrl::construct(element, Amenities, querystr( AmenitiesQuery));
Amenities – Ctrl name in form .
 
In  Modified method :
    RentalInquiryTmp_ds.executeQuery();
    RentalInquiryTmp_ds.refresh();
    RentalInquiryTmp_ds.reread();
 

No comments:

Post a Comment