{
  "pluginname": "Company",
  "version": 1.4,
  "table_def": [
    {
      "name": "company",
      "fields": [
        {
          "name": "company",
          "type": "varchar(50)",
          "other": "NOT NULL"
        },
        {
          "name": "status",
          "type": "tinyint",
          "other": "NOT NULL DEFAULT 1"
        }
      ]
    }
  ],
  "form": {
    "name": "company",
    "formtype": "Default",
    "title": "Company",
    "icon": "mif-location-city fg-cyan",
    "saveButton":true,
    "savecustomid":2,
    "getrecordcustomid":3,
    "cancelButton": true,
    "width": "400px",
    "flex_row": "false",
    "field": [
      {
        "name": "company",
        "label": "Company Name",
        "fieldtype": "s",
        "type": "text",
        "maxlength": "50"
      },
      {
        "name": "status",
        "label": "Status",
        "fieldtype": "n",
        "type": "select",
        "option": "1:Active,0:Inactive"
      }
    ]
  },
  "form_html": "",
  "navbutton": [
    {
      "customid": "1",
      "caption": "Company",
      "icon": "mif-location-city fg-cyan",
      "btntype": "ribbon-button",
      "btngroup": "Others",
      "btntab": "Stock",
      "btnorder": "1",
      "onclick": "initializePlugin();"
    }
  ],
  "formbuttons": [
    {
      "name": "newCompanyForm",
      "caption": "",
      "icon": "mif-plus fg-cyan",
      "onclick": "showNewForm('company')"
    },
    {
      "name": "companyList",
      "caption": "Company List",
      "icon": "mif-location-city fg-red",
      "onclick": "getTableFromSqlStatement('1')"
    }
  ],
  "script": "",
  "sqlstatement": [
    {
      "customid": "1",
      "name": "Company List",
      "sql": {"action":"Get Table","formname":"company","validate":"users","fld":"company,status","tbl":"company","whr":"recordstatus>=1","limit":"2000"},
      "header": "Company,Status",
      "filter": true,
      "filter_fields": "company",
      "filter_fields_operator": "like",
      "filter_fields_caption": "Company Name",
      "filter_fields_type": "s",
      "filter_fields_inputtype": "text",
      "filter_fields_option": [
        {
          "fieldname": "",
          "option": ""
        }
      ],
      "edit_record": "1"
    },{
		"customid":"2",
		"name":"saveCompany",
		"sql":{"action":"Save Table","validate":"users","outputto":"html","output":"res","command":"insertorupdate","tbl":"company","fld":"company,status","fldtype":"s,n","value":"||company||,||status||","whr":"id='||ID||'","onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful","onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"}
	},{
		"customid":"3",
		"name":"getRecord",
		"sql":{"action":"Get Row","validate":"users","outputto":"html","output":"edit","tbl":"company","fld":"id,company,status","whr":"id='||ID||'","param":"ID"}
	}
  ]
}