DataSource markChanged mthod in ax 2012

Description:-

In my one of project I need to check for if select different Records like PurchId. I have grid and in DataSource I have same and different PurchId. In the grid if I select Same PurchId then One of button enable for open the selected PurchId like below.  

If I select Different PurchId then button should not be enable for open the PurchId like below.  

Code: - 

public void markChanged()
{
    GRNdetails OGRNdetails;
    str 1000 ID,ID1;
    container CON;
    int KL,j;
    super();
    //Getting Checked Record from Database Start
    OGRNdetails = GRNdetails_ds.getFirst(true);
    while (OGRNdetails.RecId != 0)
    {
        CON = conIns(CON,1,OGRNdetails.PurchId);
        OGRNdetails = GRNdetails_ds.getNext();
    }
    //Getting Checked Record from Database end

    //Check if Different Selection start
    for(KL=1;KL <= conLen(CON);KL++)
    {
        ID = conPeek(CON,KL);
        for(j=1;j<= conLen(CON);j++)
        {
            ID1 = conPeek(CON,j);
            if(ID1 != ID)
            {
                BtnOpen.enabled(false);
                break;
            }
            else
            {
                BtnOpen.enabled(true);
            }
        }
    }
    //Check if Different Selection end
}

Related Posts

Previous
Next Post »

Thanks for comments.....