{
  "formId": "dbobject",
  "entity": "DBObject",
  "title": "DB Object",
  "idField": "DBObjectId",

  "capabilities": {
    "print": false
  },

  "pages": [
    {
      "pageId": "General",
      "pageName": "General",
      "sections": [
        {
          "sectionId": "GeneralInfo",
          "sectionName": "General Information",
          "layout": { "columns": 12 },
          "fields": [
            { "fieldId": "DBObjectId", "type": "number", "DefaultValue": 0, "PostData": true, "IsVisible": false },

            {
              "fieldId": "DBObjectName",
              "label": "Object Name",
              "type": "text",
              "mandatory": true,
              "MaxLength": 100,
              "PlaceHolder": "Enter object name",
              "layout": { "colSpan": 4 }
            },
            {
              "fieldId": "DBObjectDisplayName",
              "label": "Display Name",
              "type": "text",
              "MaxLength": 100,
              "PlaceHolder": "Enter display name",
              "layout": { "colSpan": 4 }
            },
            {
              "fieldId": "DBObjectSection",
              "label": "Section",
              "type": "text",
              "MaxLength": 100,
              "PlaceHolder": "Enter section",
              "layout": { "colSpan": 4 }
            },
            {
              "fieldId": "DBObjectType",
              "label": "Object Type",
              "type": "combobox",
              "DefaultValue": 0,
              "layout": { "colSpan": 4 },
              "PickLists": [
                { "key": 0, "value": "Table" },
                { "key": 1, "value": "Procedure" },
                { "key": 2, "value": "Function" },
                { "key": 3, "value": "Trigger" },
                { "key": 4, "value": "View" }
              ]
            },
            {
              "fieldId": "DBObjectQueryType",
              "label": "Query Type",
              "type": "combobox",
              "DefaultValue": 0,
              "layout": { "colSpan": 4 },
              "PickLists": [
                { "key": 0, "value": "None" },
                { "key": 1, "value": "SQL" },
                { "key": 2, "value": "Stored Procedure" }
              ]
            },
            {
              "fieldId": "DBObjectSourceType",
              "label": "Source Type",
              "type": "combobox",
              "DefaultValue": 1,
              "layout": { "colSpan": 4 },
              "PickLists": [
                { "key": 1, "value": "Framework" },
                { "key": 2, "value": "Dev Admin" },
                { "key": 3, "value": "Imp Admin" },
                { "key": 4, "value": "Admin" },
                { "key": 5, "value": "User" }
              ]
            },
            {
              "fieldId": "DBObjectIsAnalysis",
              "label": "Is Analysis",
              "type": "checkbox",
              "DefaultValue": 0,
              "layout": { "colSpan": 3 }
            },
            {
              "fieldId": "DBObjectSortOrder",
              "label": "Sort Order",
              "type": "number",
              "DefaultValue": 0,
              "layout": { "colSpan": 3 }
            },
            {
              "fieldId": "DBObjectStatus",
              "label": "Common.status",
              "type": "combobox",
              "DefaultValue": 1,
              "layout": { "colSpan": 3 },
              "PickLists": [
                { "key": 1, "value": "Active" },
                { "key": 0, "value": "Inactive" }
              ]
            },
            {
              "fieldId": "DBObjectRemarks",
              "label": "Remarks",
              "type": "textarea",
              "MaxLength": 500,
              "PlaceHolder": "Enter remarks",
              "layout": { "colSpan": 12 }
            }
          ]
        },
        {
          "sectionId": "Fields",
          "sectionName": "Object Fields",
          "layout": { "columns": 12 },
          "fields": [],
          "grid": {
            "fieldId": "DBObjectFields",
            "allowAdd": true,
            "allowDelete": true,
            "columns": [
              { "fieldId": "DBObjectFieldsId",           "label": "Id",              "type": "number",   "IsVisible": false, "DefaultValue": 0 },
              { "fieldId": "DBObjectFieldsSlNo",         "label": "Sl No",           "type": "number"    },
              { "fieldId": "DBObjectFieldsName",         "label": "Field Name",      "type": "input"     },
              { "fieldId": "DBObjectFieldsDisplayName",  "label": "Display Name",    "type": "input"     },
              { "fieldId": "DBObjectFieldsDataType",     "label": "Data Type",       "type": "number"    },
              { "fieldId": "DBObjectFieldsSize",         "label": "Size",            "type": "number"    },
              { "fieldId": "DBObjectFieldsIsPrimaryKey", "label": "PK",              "type": "checkbox"  },
              { "fieldId": "DBObjectFieldsIsAnalysisFields", "label": "Analysis",    "type": "checkbox"  },
              { "fieldId": "DBObjectFieldsAggregation",  "label": "Aggregation",     "type": "number"    }
            ]
          }
        }
      ]
    }
  ],

  "api": {
    "save": "Framework.DBObject.Save",
    "update": "Framework.DBObject.Save",
    "delete": "Framework.DBObject.Delete",
    "get": "Framework.DBObject.Get"
  }
}
