IDEMPIERE-4130 MaxQueryRecords by Tab (FHCA-1115)

This commit is contained in:
Carlos Ruiz 2019-12-18 23:07:01 +01:00
parent 0ae68806f6
commit 3041228c45
13 changed files with 350 additions and 27 deletions

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_V
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description, SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y' WHERE t.IsActive='Y'

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description, SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID) INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_V
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description, SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y' WHERE t.IsActive='Y'

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description, SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID) INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -0,0 +1,122 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4130 MaxQueryRecords by Tab (FHCA-1115)
-- Dec 18, 2019, 10:20:27 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214163,0,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,'MaxQueryRecords','0',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_DATE('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,2854,'Y','N','D','N','N','N','Y','33a4790c-3b91-474d-9c36-0cc85af4b700','Y',0,'N','N','N','N')
;
-- Dec 18, 2019, 10:20:44 PM CET
ALTER TABLE AD_Tab ADD MaxQueryRecords NUMBER(10) DEFAULT 0
;
-- Dec 18, 2019, 10:21:56 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206373,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,214163,'Y',10,350,'N','N','N','N',0,0,'Y',TO_DATE('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27fb6d6a-0562-4de7-a9a8-7772daca44a0','Y',330,2)
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206373
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11265
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=929
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11998
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=271
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11266
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1548
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1550
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1549
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4956
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201811
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5131
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3205
;
CREATE OR REPLACE VIEW AD_TAB_V
(AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME, DESCRIPTION,
HELP, SEQNO, ISSINGLEROW, HASTREE, ISINFOTAB,
REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED, ISDELETEABLE,
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
CREATE OR REPLACE VIEW AD_TAB_VT
(AD_LANGUAGE, AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME,
DESCRIPTION, HELP, SEQNO, ISSINGLEROW, HASTREE,
ISINFOTAB, REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED,
ISDELETEABLE, ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB,
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
SELECT register_migration_script('201912182232_IDEMPIERE-4130.sql') FROM dual
;

View File

@ -0,0 +1,119 @@
-- IDEMPIERE-4130 MaxQueryRecords by Tab (FHCA-1115)
-- Dec 18, 2019, 10:20:27 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214163,0,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,'MaxQueryRecords','0',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,2854,'Y','N','D','N','N','N','Y','33a4790c-3b91-474d-9c36-0cc85af4b700','Y',0,'N','N','N','N')
;
-- Dec 18, 2019, 10:20:44 PM CET
ALTER TABLE AD_Tab ADD COLUMN MaxQueryRecords NUMERIC(10) DEFAULT '0'
;
-- Dec 18, 2019, 10:21:56 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206373,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,214163,'Y',10,350,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27fb6d6a-0562-4de7-a9a8-7772daca44a0','Y',330,2)
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206373
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11265
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=929
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11998
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=271
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11266
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1548
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1550
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1549
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4956
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201811
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5131
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3205
;
CREATE OR REPLACE VIEW AD_TAB_V
(AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME, DESCRIPTION,
HELP, SEQNO, ISSINGLEROW, HASTREE, ISINFOTAB,
REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED, ISDELETEABLE,
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
CREATE OR REPLACE VIEW AD_TAB_VT
(AD_LANGUAGE, AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME,
DESCRIPTION, HELP, SEQNO, ISSINGLEROW, HASTREE,
ISINFOTAB, REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED,
ISDELETEABLE, ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB,
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
SELECT register_migration_script('201912182232_IDEMPIERE-4130.sql') FROM dual
;

View File

@ -112,7 +112,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
/** /**
* *
*/ */
private static final long serialVersionUID = -3115353522698098211L; private static final long serialVersionUID = 5057703093968124177L;
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
@ -3392,4 +3392,44 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
public void setCalloutUI(ICalloutUI calloutUI) { public void setCalloutUI(ICalloutUI calloutUI) {
this.calloutUI = calloutUI; this.calloutUI = calloutUI;
} }
/** Get Max Query Records.
* @return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords() {
// minimum between AD_Tab.MaxQueryRecords and AD_Role.MaxQueryRecords
int roleMaxQueryRecords = MRole.getDefault().getMaxQueryRecords();
int tabMaxQueryRecords = m_vo.MaxQueryRecords;
if (roleMaxQueryRecords > 0 && roleMaxQueryRecords < tabMaxQueryRecords)
tabMaxQueryRecords = roleMaxQueryRecords;
return tabMaxQueryRecords;
}
/**
* Require Query
* @param noRecords records
* @return true if query required
*/
public boolean isQueryRequire (int noRecords)
{
if (noRecords < 2)
return false;
int max = getMaxQueryRecords();
if (max > 0 && noRecords > max)
return true;
int qu = MRole.getDefault().getConfirmQueryRecords();
return (noRecords > qu);
} // isQueryRequire
/**
* Over max Query
* @param noRecords records
* @return true if over max query
*/
public boolean isQueryMax (int noRecords)
{
int max = getMaxQueryRecords();
return max > 0 && noRecords > max;
} // isQueryMax
} // GridTab } // GridTab

View File

@ -41,7 +41,7 @@ public class GridTabVO implements Evaluatee, Serializable
/** /**
* *
*/ */
private static final long serialVersionUID = -1353087123788176368L; private static final long serialVersionUID = 9091214632840854495L;
/************************************************************************** /**************************************************************************
* Create MTab VO * Create MTab VO
@ -206,6 +206,8 @@ public class GridTabVO implements Evaluatee, Serializable
vo.TreeDisplayedOn = rs.getString("TreeDisplayedOn"); vo.TreeDisplayedOn = rs.getString("TreeDisplayedOn");
vo.MaxQueryRecords = rs.getInt("MaxQueryRecords");
vo.AD_Table_ID = rs.getInt("AD_Table_ID"); vo.AD_Table_ID = rs.getInt("AD_Table_ID");
vo.TableName = rs.getString("TableName"); vo.TableName = rs.getString("TableName");
if (rs.getString("IsView").equals("Y")) if (rs.getString("IsView").equals("Y"))
@ -436,6 +438,8 @@ public class GridTabVO implements Evaluatee, Serializable
public boolean HasTree = false; public boolean HasTree = false;
/** Tree displayed on */ /** Tree displayed on */
public String TreeDisplayedOn = ""; public String TreeDisplayedOn = "";
/** Max Query Records */
public int MaxQueryRecords = 0;
/** Table */ /** Table */
public int AD_Table_ID; public int AD_Table_ID;
/** Table UUID */ /** Table UUID */
@ -553,6 +557,7 @@ public class GridTabVO implements Evaluatee, Serializable
clone.IsInsertRecord = IsInsertRecord; clone.IsInsertRecord = IsInsertRecord;
clone.HasTree = HasTree; clone.HasTree = HasTree;
clone.TreeDisplayedOn = TreeDisplayedOn; clone.TreeDisplayedOn = TreeDisplayedOn;
clone.MaxQueryRecords = MaxQueryRecords;
clone.AD_Table_ID = AD_Table_ID; clone.AD_Table_ID = AD_Table_ID;
clone.AD_Column_ID = AD_Column_ID; clone.AD_Column_ID = AD_Column_ID;
clone.Parent_Column_ID = Parent_Column_ID; clone.Parent_Column_ID = Parent_Column_ID;

View File

@ -428,6 +428,19 @@ public interface I_AD_Tab
*/ */
public boolean isTranslationTab(); public boolean isTranslationTab();
/** Column name MaxQueryRecords */
public static final String COLUMNNAME_MaxQueryRecords = "MaxQueryRecords";
/** Set Max Query Records.
* If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public void setMaxQueryRecords (int MaxQueryRecords);
/** Get Max Query Records.
* If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords();
/** Column name Name */ /** Column name Name */
public static final String COLUMNNAME_Name = "Name"; public static final String COLUMNNAME_Name = "Name";

View File

@ -30,7 +30,7 @@ public class X_AD_Tab extends PO implements I_AD_Tab, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20191121L; private static final long serialVersionUID = 20191218L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName) public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName)
@ -674,6 +674,26 @@ public class X_AD_Tab extends PO implements I_AD_Tab, I_Persistent
return false; return false;
} }
/** Set Max Query Records.
@param MaxQueryRecords
If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public void setMaxQueryRecords (int MaxQueryRecords)
{
set_Value (COLUMNNAME_MaxQueryRecords, Integer.valueOf(MaxQueryRecords));
}
/** Get Max Query Records.
@return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MaxQueryRecords);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name. /** Set Name.
@param Name @param Name
Alphanumeric identifier of the entity Alphanumeric identifier of the entity

View File

@ -657,7 +657,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
private void initFirstTabpanel() { private void initFirstTabpanel() {
adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, adTabbox.getSelectedGridTab().getMaxQueryRecords());
adTabbox.getSelectedTabpanel().activate(true); adTabbox.getSelectedTabpanel().activate(true);
Events.echoEvent(new Event(ADTabpanel.ON_POST_INIT_EVENT, adTabbox.getSelectedTabpanel())); Events.echoEvent(new Event(ADTabpanel.ON_POST_INIT_EVENT, adTabbox.getSelectedTabpanel()));
} }
@ -705,7 +705,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
mTab.getTableName(), MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); mTab.getTableName(), MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
int no = DB.getSQLValue(null, finalSQL.toString()); int no = DB.getSQLValue(null, finalSQL.toString());
// //
require = MRole.getDefault().isQueryRequire(no); require = mTab.isQueryRequire(no);
} }
// Show Query // Show Query
if (require) if (require)
@ -2060,7 +2060,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
m_onlyCurrentRows = false; // search history too m_onlyCurrentRows = false; // search history too
adTabbox.getSelectedGridTab().setQuery(query); adTabbox.getSelectedGridTab().setQuery(query);
adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, adTabbox.getSelectedGridTab().getMaxQueryRecords()); // autoSize
} }
if (findWindow.isCreateNew()) if (findWindow.isCreateNew())

View File

@ -58,7 +58,6 @@ import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MImportTemplate; import org.compiere.model.MImportTemplate;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -345,14 +344,14 @@ public class CSVImportAction implements EventListener<Event>
if (query != null) { if (query != null) {
query.addRestriction("1=1"); query.addRestriction("1=1");
panel.getActiveGridTab().setQuery(query); panel.getActiveGridTab().setQuery(query);
panel.getADTab().getSelectedTabpanel().query(false, 0, MRole.getDefault().getMaxQueryRecords()); panel.getADTab().getSelectedTabpanel().query(false, 0, panel.getActiveGridTab().getMaxQueryRecords());
} }
panel.getActiveGridTab().dataRefresh(false); panel.getActiveGridTab().dataRefresh(false);
if (detailQuery != null){ if (detailQuery != null){
detailQuery.addRestriction("1=1"); detailQuery.addRestriction("1=1");
panel.getADTab().getSelectedDetailADTabpanel().getGridTab().setQuery(detailQuery); panel.getADTab().getSelectedDetailADTabpanel().getGridTab().setQuery(detailQuery);
panel.getADTab().getSelectedDetailADTabpanel().query(false, 0, MRole.getDefault().getMaxQueryRecords()); panel.getADTab().getSelectedDetailADTabpanel().query(false, 0, panel.getActiveGridTab().getMaxQueryRecords());
panel.getADTab().getSelectedDetailADTabpanel().getGridTab().dataRefresh(false); panel.getADTab().getSelectedDetailADTabpanel().getGridTab().dataRefresh(false);
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -127,16 +127,15 @@ import org.zkoss.zul.Vlayout;
*/ */
public class FindWindow extends Window implements EventListener<Event>, ValueChangeListener, DialogEvents public class FindWindow extends Window implements EventListener<Event>, ValueChangeListener, DialogEvents
{ {
/**
*
*/
private static final long serialVersionUID = 2958810511464597943L;
private static final String FIND_ROW_EDITOR = "find.row.editor"; private static final String FIND_ROW_EDITOR = "find.row.editor";
private static final String FIND_ROW_EDITOR_TO = "find.row.editor.to"; private static final String FIND_ROW_EDITOR_TO = "find.row.editor.to";
/**
*
*/
private static final long serialVersionUID = -7374857601424061640L;
// values and label for history combo // values and label for history combo
private static final String HISTORY_DAY_ALL = "All"; private static final String HISTORY_DAY_ALL = "All";
private static final String HISTORY_DAY_YEAR = "Year"; private static final String HISTORY_DAY_YEAR = "Year";
@ -174,6 +173,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private String m_whereExtended; private String m_whereExtended;
/** Search Fields */ /** Search Fields */
private GridField[] m_findFields; private GridField[] m_findFields;
/** The Tab */
private GridTab m_gridTab = null;
/** Resulting query */ /** Resulting query */
private MQuery m_query = null; private MQuery m_query = null;
/** Is cancel ? */ /** Is cancel ? */
@ -268,6 +269,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
m_tableName = tableName; m_tableName = tableName;
m_whereExtended = whereExtended; m_whereExtended = whereExtended;
m_findFields = findFields; m_findFields = findFields;
if (findFields != null && findFields.length > 0)
m_gridTab = findFields[0].getGridTab();
m_sNew = "** ".concat(Msg.getMsg(Env.getCtx(), "New Query")).concat(" **"); m_sNew = "** ".concat(Msg.getMsg(Env.getCtx(), "New Query")).concat(" **");
m_AD_Tab_ID = adTabId; m_AD_Tab_ID = adTabId;
m_minRecords = minRecords; m_minRecords = minRecords;
@ -2357,15 +2360,14 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
rs = null; rs = null;
stmt = null; stmt = null;
} }
MRole role = MRole.getDefault();
// No Records // No Records
/* if (m_total == 0 && alertZeroRecords) /* if (m_total == 0 && alertZeroRecords)
FDialog.warn(m_targetWindowNo, this, "FindZeroRecords");*/ FDialog.warn(m_targetWindowNo, this, "FindZeroRecords");*/
// More then allowed // More then allowed
if (query != null && role.isQueryMax(m_total)) if (m_gridTab != null && query != null && m_gridTab.isQueryMax(m_total))
{ {
FDialog.error(m_targetWindowNo, this, "FindOverMax", FDialog.error(m_targetWindowNo, this, "FindOverMax",
m_total + " > " + role.getMaxQueryRecords()); m_total + " > " + m_gridTab.getMaxQueryRecords());
m_total = 0; // return 0 if more then allowed - teo_sarca [ 1708717 ] m_total = 0; // return 0 if more then allowed - teo_sarca [ 1708717 ]
} }
else else
@ -2553,8 +2555,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
*/ */
public MQuery getQuery() public MQuery getQuery()
{ {
MRole role = MRole.getDefault(); if (m_gridTab != null && m_gridTab.isQueryMax(getTotalRecords()) && !m_isCancel)
if (role.isQueryMax(getTotalRecords()) && !m_isCancel)
{ {
m_query = MQuery.getNoRecordQuery (m_tableName, false); m_query = MQuery.getNoRecordQuery (m_tableName, false);
m_total = 0; m_total = 0;