---
sourceDocument: Yokohama-API-Referenz
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - de-DE

ft:publication_title :

    - Yokohama-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Abstraktes DBObjekt -- Global

# Abstraktes DBObjekt -- Global {#ariaid-title1}

* Freigeben Version: Yokohama
* 
* Aktualisiert 30. Januar 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Die Abstraktes DBObjekt Die Skripteinbindung bietet allgemeine Methoden für Klassen basierend auf Datensätzen in der Datenbank.

Verwenden Sie diese Skripteinbindung als Basisklasse, um eine eigene Datenbankobjektklasse zu erstellen.

## AbstractDBObject -- isValid() {#ariaid-title2}

Bestimmt, ob der aktuelle Datenbankdatensatz gültig ist.
Siehe auch [IPService -- Global](https://servicenow-prod.fluidtopics.net/1Tz7hKpG5DI4hIyqcDge4w#c_IPServiceAPI "Die IPService Die Skripteinbindung stellt Methoden bereit, die einen IP-Service kapseln.").
{#r_ADBO-isValid__table_axq_zpc_pt__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| Keine |   |   |
[Tabelle : 1. Parameter]

{#r_ADBO-isValid__table_axq_zpc_pt} {#r_ADBO-isValid__table_bxq_zpc_pt__entry__2}

| Typ | Beschreibung |
|-|-|
| Boolean | „Wahr", wenn der Datenbankdatensatz gültig ist, andernfalls „falsch". Kennzeichnung, die angibt, ob der Datenbankdatensatz gültig ist. Gültige Werte: * Wahr: Der Datenbankdatensatz ist gültig. * Falsch: Der Datenbankdatensatz ist ungültig. {#r_ADBO-isValid__ul_sjw_bkv_hrb} |
[Tabelle : 2. Rückgaben]

{#r_ADBO-isValid__table_bxq_zpc_pt}  
Das folgende Beispiel zeigt, wie Sie eine Liste gültiger Instanzen mithilfe der Klasse „IPService()" aus der Tabelle „IP-Services" \[cmdb_ip_Service\] abrufen. Die IPService-Klasse erweitert die Klasse AbstractDBObject().

    /**
     * IPService class Encapsulates the notion of an IP Service. Instances in which isValid() returns true have the 
     * following properties initialized: 
     *  sysID:       sys_id of this record
     *  port:        the TCP or UDP port used by the service
     *  protocol:    protocol used by the service ("UDP", "TCP", or "TCP/UDP")
     *  name:        short name or handle
     *  serviceName: long, descriptive English name
     *  creates:     table that this service creates entries in
     *  description: description
     */

    var result = [];
    // Array of sys_id's from the IP Service class which we want to get the abstract details
    var list = ['db9840e10ab3015500f5e3fe8f78da42', 'a1505ebc7782330099808d1168106179', 'abc05ebc7782330099808d1168106112'];

    // query for the records on the list
    var ipservice = new GlideRecord('cmdb_ip_service');
    ipservice.addQuery('sys_id', 'IN', list.toString());
    ipservice.query();
    while (ipservice.next()) {
        var ip = new IPService(ipservice); // IPService class extends AbstractDBObject class and this class 
        if (ip.isValid())      // check whether the record is valid or not
            result.push(ip);   // if valid get the properties for 
    }

    gs.info(JSON.stringify(result, null, 2));

Ausgabe:

    [
      {
        "valid": true,
        "sysID": "a1505ebc7782330099808d1168106179",
        "port": "8882",
        "protocol": "TCP",
        "name": "blkbry-uem-enroll",
        "serviceName": "Blackberry Enrollment Request",
        "creates": null,
        "description": null
      },
      {
        "valid": true,
        "sysID": "db9840e10ab3015500f5e3fe8f78da42",
        "port": "548",
        "protocol": "TCP",
        "name": "afp",
        "serviceName": "Apple File Protocol",
        "creates": null,
        "description": null
      }
    ]


