From 04232cb5c83a5df5e793799bf370a1f9e2df388d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 30 Jan 2008 04:52:15 +0000 Subject: [PATCH] [ 1876642 ] Add Collapsed by Default to Field Group --- migration/331b-trunk/083_FR1876642.sql | 35 +++++ migration/331b-trunk/084_FR1876642_views.sql | 79 ++++++++++ .../331b-trunk/postgresql/083_FR1876642.sql | 35 +++++ .../postgresql/083_FR1876642_views.sql | 135 ++++++++++++++++++ 4 files changed, 284 insertions(+) create mode 100644 migration/331b-trunk/083_FR1876642.sql create mode 100644 migration/331b-trunk/084_FR1876642_views.sql create mode 100644 migration/331b-trunk/postgresql/083_FR1876642.sql create mode 100644 migration/331b-trunk/postgresql/083_FR1876642_views.sql diff --git a/migration/331b-trunk/083_FR1876642.sql b/migration/331b-trunk/083_FR1876642.sql new file mode 100644 index 0000000000..1a5fda3883 --- /dev/null +++ b/migration/331b-trunk/083_FR1876642.sql @@ -0,0 +1,35 @@ +-- Jan 30, 2008 10:11:15 AM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53336,0,'IsCollapsedByDefault',TO_DATE('2008-01-30 10:11:13','YYYY-MM-DD HH24:MI:SS'),100,'Flag to set the initial state of collapsible field group.','U','Y','Collapsed By Default','Collapsed By Default',TO_DATE('2008-01-30 10:11:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jan 30, 2008 10:11:16 AM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53336 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jan 30, 2008 12:07:42 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,54259,53336,0,20,414,'IsCollapsedByDefault',TO_DATE('2008-01-30 12:07:41','YYYY-MM-DD HH24:MI:SS'),100,'N','Flag to set the initial state of collapsible field group.','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Collapsed By Default',0,TO_DATE('2008-01-30 12:07:41','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jan 30, 2008 12:07:42 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=54259 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jan 30, 2008 12:09:43 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,DisplayLogic,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,54259,54348,0,342,TO_DATE('2008-01-30 12:09:42','YYYY-MM-DD HH24:MI:SS'),100,'Flag to set the initial state of collapsible field group.',0,'@FieldGroupType@=''C''','D','Y','Y','Y','N','N','N','N','N','Collapsed By Default',70,0,TO_DATE('2008-01-30 12:09:42','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jan 30, 2008 12:09:43 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=54348 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +; + +-- Jan 30, 2008 12:10:36 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +ALTER TABLE AD_FieldGroup ADD IsCollapsedByDefault CHAR(1) DEFAULT 'N' CHECK (IsCollapsedByDefault IN ('Y','N')) +; + diff --git a/migration/331b-trunk/084_FR1876642_views.sql b/migration/331b-trunk/084_FR1876642_views.sql new file mode 100644 index 0000000000..5af3752525 --- /dev/null +++ b/migration/331b-trunk/084_FR1876642_views.sql @@ -0,0 +1,79 @@ +CREATE OR REPLACE VIEW AD_FIELD_V +(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID, + NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC, + DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING, + ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME, + COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY, + ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID, + CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE, + READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, + TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, + INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault) +AS +SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable, + c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, + c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fg.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault +FROM AD_FIELD f + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) +WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y' +; + +CREATE OR REPLACE VIEW AD_FIELD_VT +(AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, + AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED, + DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, + ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, + COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, + ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, + AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, + ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, + ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, + VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault) +AS +SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable, + c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fgt.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault +FROM AD_FIELD f + INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON + (f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) +WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y' +; diff --git a/migration/331b-trunk/postgresql/083_FR1876642.sql b/migration/331b-trunk/postgresql/083_FR1876642.sql new file mode 100644 index 0000000000..1e8d1cbdd7 --- /dev/null +++ b/migration/331b-trunk/postgresql/083_FR1876642.sql @@ -0,0 +1,35 @@ +-- Jan 30, 2008 10:11:15 AM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53336,0,'IsCollapsedByDefault',TO_TIMESTAMP('2008-01-30 10:11:13','YYYY-MM-DD HH24:MI:SS'),100,'Flag to set the initial state of collapsible field group.','U','Y','Collapsed By Default','Collapsed By Default',TO_TIMESTAMP('2008-01-30 10:11:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jan 30, 2008 10:11:16 AM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53336 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jan 30, 2008 12:07:42 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,54259,53336,0,20,414,'IsCollapsedByDefault',TO_TIMESTAMP('2008-01-30 12:07:41','YYYY-MM-DD HH24:MI:SS'),100,'N','Flag to set the initial state of collapsible field group.','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Collapsed By Default',0,TO_TIMESTAMP('2008-01-30 12:07:41','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jan 30, 2008 12:07:42 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=54259 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jan 30, 2008 12:09:43 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,DisplayLogic,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,54259,54348,0,342,TO_TIMESTAMP('2008-01-30 12:09:42','YYYY-MM-DD HH24:MI:SS'),100,'Flag to set the initial state of collapsible field group.',0,'@FieldGroupType@=''C''','D','Y','Y','Y','N','N','N','N','N','Collapsed By Default',70,0,TO_TIMESTAMP('2008-01-30 12:09:42','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jan 30, 2008 12:09:43 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=54348 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +; + +-- Jan 30, 2008 12:10:36 PM SGT +-- [ 1876642 ] Add Collapsed by Default to Field Group +ALTER TABLE AD_FieldGroup ADD COLUMN IsCollapsedByDefault CHAR(1) DEFAULT 'N' CHECK (IsCollapsedByDefault IN ('Y','N')) +; + diff --git a/migration/331b-trunk/postgresql/083_FR1876642_views.sql b/migration/331b-trunk/postgresql/083_FR1876642_views.sql new file mode 100644 index 0000000000..e73b6e32e0 --- /dev/null +++ b/migration/331b-trunk/postgresql/083_FR1876642_views.sql @@ -0,0 +1,135 @@ +CREATE OR +REPLACE VIEW ad_field_v AS +SELECT t.ad_window_id, + f.ad_tab_id, + f.ad_field_id, + tbl.ad_table_id, + f.ad_column_id, + f.NAME, + f.description, + f.help, + f.isdisplayed, + f.displaylogic, + f.displaylength, + f.seqno, + f.sortno, + f.issameline, + f.isheading, + f.isfieldonly, + f.isreadonly, + f.isencrypted AS isencryptedfield, + f.obscuretype, + C.columnname, + C.columnsql, + C.fieldlength, + C.vformat, + C.defaultvalue, + C.iskey, + C.isparent, + COALESCE(f.ismandatory, C.ismandatory) AS ismandatory, + C.isidentifier, + C.istranslated, + C.ad_reference_value_id, + C.callout, + COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id, + C.ad_val_rule_id, + C.ad_process_id, + C.isalwaysupdateable, + C.readonlylogic, + C.isupdateable, + C.isencrypted AS isencryptedcolumn, + C.isselectioncolumn, + tbl.tablename, + C.valuemin, + C.valuemax, + fg.NAME AS fieldgroup, + vr.code AS validationcode, + f.Included_Tab_ID, + fg.FieldGroupType, + fg.IsCollapsedByDefault AS iscollapsedbydefault +FROM ((((((AD_FIELD f + JOIN AD_TAB t + ON ((f.ad_tab_id = t.ad_tab_id))) + LEFT JOIN AD_FIELDGROUP fg + ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id))) + LEFT JOIN AD_COLUMN C + ON ((f.ad_column_id = C.ad_column_id))) + JOIN AD_TABLE tbl + ON ((C.ad_table_id = tbl.ad_table_id))) + JOIN AD_REFERENCE r + ON ((C.ad_reference_id = r.ad_reference_id))) + LEFT JOIN AD_VAL_RULE vr + ON ((C.ad_val_rule_id = vr.ad_val_rule_id))) +WHERE ((f.isactive = 'Y'::bpchar) AND + (C.isactive = 'Y'::bpchar)); + +CREATE OR +REPLACE VIEW ad_field_vt AS +SELECT trl.AD_LANGUAGE, + t.ad_window_id, + f.ad_tab_id, + f.ad_field_id, + tbl.ad_table_id, + f.ad_column_id, + trl.NAME, + trl.description, + trl.help, + f.isdisplayed, + f.displaylogic, + f.displaylength, + f.seqno, + f.sortno, + f.issameline, + f.isheading, + f.isfieldonly, + f.isreadonly, + f.isencrypted AS isencryptedfield, + f.obscuretype, + C.columnname, + C.columnsql, + C.fieldlength, + C.vformat, + C.defaultvalue, + C.iskey, + C.isparent, + COALESCE(f.ismandatory, C.ismandatory) AS ismandatory, + C.isidentifier, + C.istranslated, + C.ad_reference_value_id, + C.callout, + COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id, + C.ad_val_rule_id, + C.ad_process_id, + C.isalwaysupdateable, + C.readonlylogic, + C.isupdateable, + C.isencrypted AS isencryptedcolumn, + C.isselectioncolumn, + tbl.tablename, + C.valuemin, + C.valuemax, + fgt.NAME AS fieldgroup, + vr.code AS validationcode, + f.Included_Tab_ID, + fg.FieldGroupType, + fg.IsCollapsedByDefault AS iscollapsedbydefault +FROM (((((((AD_FIELD f + JOIN AD_FIELD_TRL trl + ON ((f.ad_field_id = trl.ad_field_id))) + JOIN AD_TAB t + ON ((f.ad_tab_id = t.ad_tab_id))) + LEFT JOIN AD_FIELDGROUP fg + ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT JOIN AD_FIELDGROUP_TRL fgt + ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND + ((trl.AD_LANGUAGE)::text = (fgt.AD_LANGUAGE)::text)))) + LEFT JOIN AD_COLUMN C + ON ((f.ad_column_id = C.ad_column_id))) + JOIN AD_TABLE tbl + ON ((C.ad_table_id = tbl.ad_table_id))) + JOIN AD_REFERENCE r + ON ((C.ad_reference_id = r.ad_reference_id))) + LEFT JOIN AD_VAL_RULE vr + ON ((C.ad_val_rule_id = vr.ad_val_rule_id))) +WHERE ((f.isactive = 'Y'::bpchar) AND + (C.isactive = 'Y'::bpchar));