|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object servicenow.community.soap.GlideRecord
public class GlideRecord
Contains an XML document (in the form of a JDOM Element) which has been retrieved from ServiceNow. The only way to obtain one of these is to use GlideTable.get() or GlideTable.getRecords().
Field Summary | |
---|---|
protected GlideDateTime |
createdTimestamp
|
protected org.jdom2.Element |
element
|
protected GlideKey |
key
|
protected GlideTable |
table
|
protected GlideDateTime |
updatedTimestamp
|
Constructor Summary | |
---|---|
protected |
GlideRecord(GlideTable table,
org.jdom2.Element element)
|
Method Summary | |
---|---|
boolean |
getBoolean(java.lang.String fieldname)
|
GlideDateTime |
getCreatedTimestamp()
Get sys_created_on from a GlideRecord object. |
GlideDateTime |
getDate(java.lang.String fieldname)
Return a Date field as a GlideDateTime. |
GlideDateTime |
getDateTime(java.lang.String fieldname)
Return a DateTime field as a GlideDateTime. |
java.lang.Integer |
getDuration(java.lang.String fieldname)
Return a duration field in seconds. |
java.lang.String |
getField(java.lang.String fieldname)
Get the value of a field from a GlideRecord. |
int |
getInt(java.lang.String fieldname)
|
GlideKey |
getKey()
Get the sys_id from a GlideRecord object. |
GlideRecord |
getRecord(java.lang.String fieldname)
If a reference field in a GlideRecord contains a valid sys_id, then return the GlideRecord to which the reference field points. |
GlideRecord |
getRecord(java.lang.String fieldname,
GlideTable table)
If a reference field in a GlideRecord contains a valid sys_id, then return the GlideRecord to which the reference field points. |
GlideKey |
getReference(java.lang.String fieldname)
|
GlideTable |
getTable()
|
GlideDateTime |
getUpdatedTimestamp()
Get sys_updated_on from a GlideRecord object. |
java.lang.String |
getXML()
Returns this object as an XML string. |
int |
numFields()
|
void |
setBoolean(java.lang.String fieldname,
boolean value)
|
void |
setField(java.lang.String fieldname,
java.lang.String fieldvalue)
|
void |
setInt(java.lang.String fieldname,
int value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final GlideTable table
protected final GlideKey key
protected final org.jdom2.Element element
protected GlideDateTime updatedTimestamp
protected GlideDateTime createdTimestamp
Constructor Detail |
---|
protected GlideRecord(GlideTable table, org.jdom2.Element element) throws SoapResponseException
SoapResponseException
Method Detail |
---|
public GlideTable getTable()
public int numFields()
public java.lang.String getXML()
public java.lang.String getField(java.lang.String fieldname) throws InvalidFieldNameException
fieldname
- Name of GlideRecord field
InvalidFieldNameException
public GlideKey getKey()
public GlideKey getReference(java.lang.String fieldname) throws InvalidFieldNameException
InvalidFieldNameException
public GlideDateTime getUpdatedTimestamp()
public GlideDateTime getCreatedTimestamp()
public GlideRecord getRecord(java.lang.String fieldname, GlideTable table) throws java.io.IOException
fieldname
- Name of the reference field.table
- GlideTable to which the reference field points,
or null if the value of the reference field is null.
java.io.IOException
public GlideRecord getRecord(java.lang.String fieldname) throws java.io.IOException
name
to the manager of the "Network Support" group.
The get
function returns a GlideRecord
for the sys_user_group table and the the
getRecord
function returns a GlideRecord
for the sys_user table.
However, if the
group has no manager this code will throw a NullPointerException.
String name = instance.table("sys_user_group").get("name", "Network Support"). getRecord("manager").getField("name");
fieldname
- Name of the reference field.
java.io.IOException
public int getInt(java.lang.String fieldname)
public GlideDateTime getDateTime(java.lang.String fieldname) throws java.text.ParseException
java.text.ParseException
public GlideDateTime getDate(java.lang.String fieldname) throws java.text.ParseException
java.text.ParseException
public boolean getBoolean(java.lang.String fieldname) throws java.text.ParseException
java.text.ParseException
public java.lang.Integer getDuration(java.lang.String fieldname) throws java.text.ParseException
java.text.ParseException
public void setField(java.lang.String fieldname, java.lang.String fieldvalue)
public void setInt(java.lang.String fieldname, int value)
public void setBoolean(java.lang.String fieldname, boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |