Firing an action if a value in between two Range Values?

Hi All,

I want to trigger an info message if a value is in between two range values

Ex:

1.If a Value is in between 10 to 30 then i want to print Info msg as “Value is in between 10 to 30”

  1. If a Value is in between 30 to 50 then i want to print Info msg as “Value is in between 30 to 50”

Give me your ideas to achieve this functionality

Thanks in Advance [:)]

whether you want where to write it or how to write it?

how to write: info(strfmt(“Value is in between %1 to %2”,field1,field2));

where to write: You can write it in many places.

one way is overriding the validateWrite method.(presuming that your are going to show this info while the entry in a form)

Normal conditional functions r enough…

Hi Kranthi,

Thanks for your Reply

Please correct below code it is not working for me

Suggest me if any other ideas

public void init()
{

super();

if(ProdTable.QtySched <= 1 || ProdTable.QtySched <= 25)
{
Group1.visible(True);
}
if(ProdTable.QtySched <= 26 || ProdTable.QtySched <= 50)
{
Group2.visible(True);
}
else if (ProdTable.QtySched >= 51 && ProdTable.QtySched <= 90)
{
Group3.visible(True);
}
else if (ProdTable.QtySched > 90 && ProdTable.QtySched <= 150)
{
Group4.visible(True);
}
else if (ProdTable.QtySched > 150 && ProdTable.QtySched <= 280)
{
Group5.visible(True);
}
else if (ProdTable.QtySched > 280 && ProdTable.QtySched <= 500)
{
Group6.visible(True);
}
else if (ProdTable.QtySched > 500 && ProdTable.QtySched <= 1200)
{
Group7.visible(True);
}
else if (ProdTable.QtySched > 1200 && ProdTable.QtySched <= 3200)
{
Group8.visible(True);
}
else if (ProdTable.QtySched > 3200 && ProdTable.QtySched <= 10000)
{
Group9.visible(True);
}
else
{
info(“Please Enter Valid AQL Values”);
}

}

Hai Bobby

I feel in first two if conditions ua logic has to be changed as

if(ProdTable.QtySched <= 25)
{
Group1.visible(True);
}
if(| ProdTable.QtySched <= 50)
{
Group2.visible(True);
}

or

do you mean like

if(ProdTable.QtySched >= 1 || ProdTable.QtySched <= 25)
{
Group1.visible(True);
}
if(ProdTable.QtySched >= 26 || ProdTable.QtySched <= 50)
{
Group2.visible(True);

}

and if you need to display info message for each range limits.Include within the if condition.

I don know whether this would suffice your requirement.

Check these 2 conditions - less than or equal 1 or 25.

the else statement is for which if condition.

Hi,

You can use simple if else statement

EG :

if(ProdTable.QtySched >= 1 && ProdTable.QtySched <= 25)

{

}

else if(ProdTable.QtySched <=50)

{

}

else if(ProdTable.QtySched <=90)

{

}

.

.

.

.

Hi Bobby,

You can do in this way.

if(ProdTableQty.QtySched >= 1 && ProdTableQty.QtySched<=25)

{

Group1.Visible(false);

}

else if(ProdTableQty.QtySched >= 26 && ProdTableQty.QtySched<=50)

{

}

else if(ProdTableQty.QtySched >= 51 && ProdTableQty.QtySched<=90)

{

}

.