if (Util.isEmpty(name, true))
{
ADialog.warn(m_targetWindowNo, this, "FillMandatory", Msg.translate(Env.getCtx(), "Name"));
return;
}
MUserQuery uq = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID, name);
if (uq == null && code.length() > 0)
{
uq = new MUserQuery (Env.getCtx(), 0, null);
uq.setName (name);
uq.setAD_Tab_ID(m_AD_Tab_ID); //red1 UserQuery [ 1798539 ] taking in new field from Compiere
uq.setAD_User_ID(Env.getAD_User_ID(Env.getCtx())); //red1 - [ 1798539 ] missing in Compiere delayed source :-)
}
else if (uq != null && code.length() == 0)
{
if (uq.delete(true))
{
ADialog.info (m_targetWindowNo, this, "Deleted", name);
refreshUserQueries();
}
else
ADialog.warn (m_targetWindowNo, this, "DeleteError", name);
return;
}
else
return;
uq.setCode (code.toString());
uq.setAD_Table_ID (m_AD_Table_ID);
//
if (uq.save())
{
ADialog.info (m_targetWindowNo, this, "Saved", name);
refreshUserQueries();
}
else