{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":950,"path":"api-reference/server-api-reference/c_AbstractDBObject.md","title":"AbstractDBObject - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# AbstractDBObject- Global\n\nThe AbstractDBObject script include provides common methods for classes based on records in the database.\n\nUse this script include as a base class to create your own database object class.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## AbstractDBObject - isValid\\(\\)\n\nDetermines if the current database record is valid.\n\nSee also [IPService - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_IPServiceAPI.md).\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_bxq_zpc_pt\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nTrue if the database record is valid, false otherwise.Flag that indicates whether the database record is valid.\n\n Valid values:\n\n-   true: The database record is valid.\n-   false: The database record is invalid.\n\n</td></tr></tbody>\n</table>The following example shows how to get a list of valid instances using the IPService\\(\\) class from the IP Services \\[cmdb\\_ip\\_service\\] table. The IPService class extends the AbstractDBObject\\(\\) class.\n\n```\n/**\n * IPService class Encapsulates the notion of an IP Service. Instances in which isValid() returns true have the \n * following properties initialized: \n *  sysID:       sys_id of this record\n *  port:        the TCP or UDP port used by the service\n *  protocol:    protocol used by the service (\"UDP\", \"TCP\", or \"TCP/UDP\")\n *  name:        short name or handle\n *  serviceName: long, descriptive English name\n *  creates:     table that this service creates entries in\n *  description: description\n */\n\nvar result = [];\n// Array of sys_id's from the IP Service class which we want to get the abstract details\nvar list = ['db9840e10ab3015500f5e3fe8f78da42', 'a1505ebc7782330099808d1168106179', 'abc05ebc7782330099808d1168106112'];\n\n// query for the records on the list\nvar ipservice = new GlideRecord('cmdb_ip_service');\nipservice.addQuery('sys_id', 'IN', list.toString());\nipservice.query();\nwhile (ipservice.next()) {\n    var ip = new IPService(ipservice); // IPService class extends AbstractDBObject class and this class \n    if (ip.isValid())      // check whether the record is valid or not\n        result.push(ip);   // if valid get the properties for \n}\n\ngs.info(JSON.stringify(result, null, 2));\n```\n\nOutput:\n\n```\n[\n  {\n    \"valid\": true,\n    \"sysID\": \"a1505ebc7782330099808d1168106179\",\n    \"port\": \"8882\",\n    \"protocol\": \"TCP\",\n    \"name\": \"blkbry-uem-enroll\",\n    \"serviceName\": \"Blackberry Enrollment Request\",\n    \"creates\": null,\n    \"description\": null\n  },\n  {\n    \"valid\": true,\n    \"sysID\": \"db9840e10ab3015500f5e3fe8f78da42\",\n    \"port\": \"548\",\n    \"protocol\": \"TCP\",\n    \"name\": \"afp\",\n    \"serviceName\": \"Apple File Protocol\",\n    \"creates\": null,\n    \"description\": null\n  }\n]\n```\n\n"}}