For a long time, i am unable to handle null condition in script callout in adempiere. Just take a look at this beanshell script callout.
Script Name : beanshell:AlertProductMaximumLimitExcess
- Code: Select all
maximumQty=DB.getSQLValueBD(null, "select level_max from m_replenish where m_product_id=?",mproductid);
if(maximumQty != null && maximumQty!=0 && maximumQty!=-1)
{ if(qty!= 0)
{
if(qty.compareTo(maximumqty)>0)
return Msg.getMsg("en_us",display);
}
}
what ever the maximum qty is, the code get inside the if condition. i even specified it this way
- Code: Select all
maximumQty = null;
if(maximumQty==null){
return Msg.getMsg("en_us","maximum Qty is null");
}
Thanks for your help..
regards
vivek