IDEMPIERE-5664 - Improve the message thrown by Import CSV Process when a field does not exist in the tab (#1660)

This commit is contained in:
Diego Ruiz 2023-02-03 03:13:33 +01:00 committed by GitHub
parent 560b9f4bad
commit 291a4df19e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-5564 - Improve the message thrown by Import CSV Process when a field does not exist in the tab
SELECT register_migration_script('202302021805_IDEMPIERE-5564.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Feb 2, 2023, 6:05:41 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Field {0} not found in tab {1}',0,0,'Y',TO_TIMESTAMP('2023-02-02 18:05:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-02 18:05:40','YYYY-MM-DD HH24:MI:SS'),100,200820,'FieldNotFoundInTab','D','a57c6e74-95bc-4196-9738-9a9b332dca19')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-5564 - Improve the message thrown by Import CSV Process when a field does not exist in the tab
SELECT register_migration_script('202302021805_IDEMPIERE-5564.sql') FROM dual;
-- Feb 2, 2023, 6:05:41 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Field {0} not found in tab {1}',0,0,'Y',TO_TIMESTAMP('2023-02-02 18:05:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-02 18:05:40','YYYY-MM-DD HH24:MI:SS'),100,200820,'FieldNotFoundInTab','D','a57c6e74-95bc-4196-9738-9a9b332dca19')
;

View File

@ -374,7 +374,7 @@ public class GridTabCSVImporter implements IGridTabImporter
GridField field = gridTab.getField(columnName); GridField field = gridTab.getField(columnName);
if (field == null) if (field == null)
throwAdempiereException(Msg.getMsg(Env.getCtx(), "FieldNotFound" , new Object[] {columnName}) ); throwAdempiereException(Msg.getMsg(Env.getCtx(), "FieldNotFoundInTab" , new Object[] {columnName, gridTab.getName()}) );
else if(isKeyColumn && !isThereKey) else if(isKeyColumn && !isThereKey)
isThereKey =true; isThereKey =true;
else if (!isThereDocAction && else if (!isThereDocAction &&