Monday 5 August 2013

Select and un- select multiple records on the grid

I came accross one requirement in which users need to un-select and select multiple records in the grid, For example there are aroung 100 lines in the grid and user want to un select some lines then the manual task was too time consuming. Therefore I added a small customization:


Consider the above example of delivery orders, I go to proforma invoice and click "Select packing slip"


A new form will open


Now you can filter the record based on dates or what so ever


Now you can click on the customized buton as shown below after selected the current records.


This will un check all the selected records in one go and vise versa.

Below is the code for both the buttons for reference.

//This code is for Select All button
void clicked()
{
    CustPackingSlipJour custPackingSlipJourLocal;
   
    MultiSelectionHelper helper = MultiSelectionHelper::construct();
   
    helper.parmDatasource(custPackingSlipJour_ds);
    custPackingSlipJourLocal = helper.getFirst();
   
    while (custPackingSlipJourLocal.RecId != 0)
    {
        journalSelect.included(true, custPackingSlipJourLocal, NoYes::Yes);
        custPackingSlipJourLocal = helper.getNext();
    }
 
    custPackingSlipJour_ds.research();
    super();
}

//This code is for Un-Select all button
void clicked()
{
    CustPackingSlipJour custPackingSlipJourLocal;
   
    MultiSelectionHelper helper = MultiSelectionHelper::construct();
    helper.parmDatasource(custPackingSlipJour_ds);
    custPackingSlipJourLocal = helper.getFirst();
   
    while (custPackingSlipJourLocal.RecId != 0)
    {
        journalSelect.included(true, custPackingSlipJourLocal, NoYes::No);
        custPackingSlipJourLocal = helper.getNext();
    }
 
    custPackingSlipJour_ds.research();
    super();
}

Hope this helps!

No comments:

Post a Comment