Monday, June 6, 2011

Checking inside the table if same records are selected by the user with the help of same field

function checksamelocationtype()
{
for(i=1;i<=APPA_USER_LEVEL_AUTH_MAT_LOCTable.getRows().length;i++)
{
for(j=i+1;j<=APPA_USER_LEVEL_AUTH_MAT_LOCTable.getRows().length;j++)
{
if(branch_code[i].getValue()!="")
{
if(branch_code[i].getValue()==branch_code[j].getValue())
{
application.notify("Same Branch Code is chosen more than once");

}
}
if(region_code[i].getValue()!="")
{
if(region_code[i].getValue()==region_code[j].getValue())
{
application.notify("Same Region Code is chosen more than once");

}

}
if(cluster_code[APPA_USER_LEVEL_AUTH_MAT_LOCTable.getIndex()].getValue()!="")
{
if(cluster_code[i].getValue()==cluster_code[j].getValue())
{
application.notify("Same Cluster Code is chosen more than once");

}

}



}

}
}

No comments:

Post a Comment