Fix [1651899] - AD_Column: Avoid dup. SeqNo for IsIdentifier='Y'

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=1651899&group_id=176962
Thanks to d_ruiz
This commit is contained in:
Carlos Ruiz 2009-08-04 23:12:03 +00:00
parent beb64c217c
commit 9bcbe41b13
1 changed files with 16 additions and 0 deletions

View File

@ -213,6 +213,22 @@ public class MColumn extends X_AD_Column
WHERE AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE IsView='Y')
**/
/* Diego Ruiz - globalqss - BF [1651899] - AD_Column: Avoid dup. SeqNo for IsIdentifier='Y' */
if (isIdentifier())
{
int cnt = DB.getSQLValue(get_TrxName(),"SELECT COUNT(*) FROM AD_Column "+
"WHERE AD_Table_ID=?"+
" AND AD_Column_ID!=?"+
" AND IsIdentifier='Y'"+
" AND SeqNo=?",
new Object[] {getAD_Table_ID(), getAD_Column_ID(), getSeqNo()});
if (cnt>0)
{
log.saveError("SaveErrorNotUnique", Msg.getElement(getCtx(), COLUMNNAME_SeqNo));
return false;
}
}
// Virtual Column
if (isVirtualColumn())
{