|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object servicenow.community.soap.GlideTable
public class GlideTable
Used to access a ServiceNow table. The recommended way to obtain a GlideTable object is the Instance.table() method. This class will load the table schema from sys_dictionary when it is instantiated.
Field Summary | |
---|---|
static int |
DEFAULT_CHUNK_SIZE
|
static int |
MAX_CHUNK_SIZE
|
Constructor Summary | |
---|---|
GlideTable(Instance instance,
java.lang.String tablename)
The recommended way to obtain a GlideTable object is the Instance.table() method. |
Method Summary | |
---|---|
void |
attachFile(GlideKey key,
java.io.File file)
This method attaches a file to a record in a table. |
BulkFetcher |
bulkFetcher()
|
BulkFetcher |
bulkFetcher(GlideFilter query)
|
boolean |
deleteRecord(GlideKey sysid)
Delete a record from the table. |
GlideRecord |
get(GlideKey sysid)
Returns a single record based on a sys_id. |
GlideRecord |
get(java.lang.String fieldname,
java.lang.String fieldvalue)
Retrieves a single record. |
GlideKeyList |
getKeys()
|
GlideKeyList |
getKeys(servicenow.community.soap.Parameters params)
|
java.lang.String |
getName()
|
org.jdom2.Namespace |
getNamespace()
|
java.lang.String |
getParentName()
|
GlideRecordList |
getRecords(GlideFilter filter)
|
GlideRecordList |
getRecords(GlideKeyList list)
|
GlideRecordList |
getRecords(GlideKeyList list,
int fromIndex,
int toIndex)
|
GlideRecordList |
getRecords(servicenow.community.soap.Parameters params)
|
GlideRecordList |
getRecords(java.lang.String fieldname,
java.lang.String fieldvalue)
|
GlideTableSchema |
getSchema()
Returns the table schema as obtained from sys_dictionary when the class was instantiated. |
GlideKey |
insert(FieldValues fields)
This is the normal method used to insert a new record. |
GlideKey |
insert(GlideRecord rec)
This insert method is only used when copying data. |
protected GlideTable |
loadSchema()
|
boolean |
readable()
Returns true if records can be read from a table. |
GlideTable |
setChunkSize(int chunkSize)
|
GlideTable |
setDisplayValues(boolean dv)
|
GlideTable |
setValidate(boolean validate)
|
GlideKey |
update(GlideKey sysid,
FieldValues fields)
|
GlideKey |
update(GlideRecord rec)
|
boolean |
validate()
|
void |
validateFields(FieldValues values)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_CHUNK_SIZE
public static final int MAX_CHUNK_SIZE
Constructor Detail |
---|
public GlideTable(Instance instance, java.lang.String tablename) throws java.io.IOException, InvalidTableNameException
tablename
- instance
-
org.jdom2.JDOMException
java.io.IOException
InvalidTableNameException
Method Detail |
---|
public java.lang.String getName()
public java.lang.String getParentName()
public org.jdom2.Namespace getNamespace()
protected GlideTable loadSchema() throws java.io.IOException
java.io.IOException
public GlideTableSchema getSchema()
public GlideTable setChunkSize(int chunkSize)
public GlideTable setValidate(boolean validate)
public boolean validate()
public GlideTable setDisplayValues(boolean dv) throws java.io.IOException
java.io.IOException
public void validateFields(FieldValues values) throws InvalidFieldNameException
InvalidFieldNameException
public GlideKey insert(GlideRecord rec) throws java.io.IOException
rec
- Record obtained from a previous get() or getRecords()
java.io.IOException
public GlideKey insert(FieldValues fields) throws java.io.IOException
instance.table("insert").insert(new FieldValues(). set("category","network"). set("short_description","a network error has occurred")); new FieldValues(). set("category","network"). set("short_description","a network error has occurred"). insert(instance.table("incident"));
fields
- FieldValues object containing the values to be inserted.
java.io.IOException
public boolean deleteRecord(GlideKey sysid) throws java.io.IOException
sysid
- sys_id of the record to be deleted.
java.io.IOException
org.jdom2.JDOMException
public GlideKey update(GlideRecord rec) throws java.io.IOException
java.io.IOException
public GlideKey update(GlideKey sysid, FieldValues fields) throws java.io.IOException
java.io.IOException
public GlideRecord get(java.lang.String fieldname, java.lang.String fieldvalue) throws java.io.IOException, java.lang.IndexOutOfBoundsException
GlideRecord rec = instance.table("sys_user_group").get("name", "Network Support");
fieldname
- Field name, e.g. "number" or "name"fieldvalue
- Field value
java.io.IOException
java.lang.IndexOutOfBoundsException
- Thrown if more than one record matches
the fieldvalue.public GlideRecord get(GlideKey sysid) throws java.io.IOException
GlideRecord rec = instance.table("sys_user_group").get(new GlideKey("287ebd7da9fe198100f92cc8d1d2154e"));
sysid
-
java.io.IOException
public boolean readable() throws java.io.IOException, SoapRecordLimitExceeded
java.io.IOException
SoapRecordLimitExceeded
public GlideRecordList getRecords(servicenow.community.soap.Parameters params) throws java.io.IOException, SoapRecordLimitExceeded
java.io.IOException
SoapRecordLimitExceeded
public GlideRecordList getRecords(GlideFilter filter) throws java.io.IOException, SoapRecordLimitExceeded
java.io.IOException
SoapRecordLimitExceeded
public GlideRecordList getRecords(java.lang.String fieldname, java.lang.String fieldvalue) throws java.io.IOException, SoapRecordLimitExceeded
java.io.IOException
SoapRecordLimitExceeded
public GlideRecordList getRecords(GlideKeyList list) throws java.io.IOException
java.io.IOException
public GlideRecordList getRecords(GlideKeyList list, int fromIndex, int toIndex) throws java.io.IOException
java.io.IOException
public GlideKeyList getKeys(servicenow.community.soap.Parameters params) throws java.io.IOException
java.io.IOException
public GlideKeyList getKeys() throws java.io.IOException
java.io.IOException
public BulkFetcher bulkFetcher(GlideFilter query) throws java.io.IOException
java.io.IOException
public BulkFetcher bulkFetcher() throws java.io.IOException
java.io.IOException
public void attachFile(GlideKey key, java.io.File file) throws java.io.IOException
key
- The sys_id of the record to which the file is to be attached.file
- The file that is to be attached.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |