ARSperl
view release on metacpan or search on metacpan
html/manual/OO/form.html view on Meta::CPAN
</PRE>
This is the default constructor. To make life easier, you should use
the openForm() method available in the
<a href="connection.html">Connection Object</A>.
<P>
<DT><A NAME="DESTROY"><B>destructor</B></A>
Currently, the form destructor does nothing.
<P>
<DT><A NAME="query"><B>query()</B></A>
<PRE>
@matches = $f->query(-query => scalar string,
-maxhits => scalar string,
-firstretrieve => scalar string);
</PRE>
This function allows you to run a query against a Form. Both parameters
are optional. If you specify neither, you will get a list of all
available records upto the limit imposed on the server. If you specify
a qualifier and a maxhits number, you will get matching records upto
the maximum number of hits you specified. <P>
This method returns a list of matching Record IDs. It does not
currently return a "query list".
<P>
<DT><A NAME="getFieldID"><B>getFieldID()</B></A>
<PRE>
$id = $f->getFieldID(-field => scalar string);
</PRE>
This an "internal" function that is used to translate a field name to a
field ID. Eventually, it will obey the VUI you specified.
<P>
<DT><A NAME="getFieldName"><B>getFieldName()</B></A>
<PRE>
$name = $f->getFieldName(-id => scalar string);
</PRE>
This an "internal" function that is used to translate a field ID to a
field nameD. Eventually, it will obey the VUI you specified.
<P>
<DT><A NAME="getEnumValues"><B>getEnumValues()</B></A>
<PRE>
@vals = $f->getEnumValues(-field => scalar string);
</PRE>
This function returns a list of enumeration values (labels)
for a given field. If the field is not an enumeration field,
an exception is thrown (type=ERROR, num=81006).
<P>
<DT><A NAME="getFieldType"><B>getFieldType()</B></A>
<PRE>
$type = $f->getFieldType(-name => scalar string,
-id => scalar string);
</PRE>
This an "internal" function that is used to retrieve the datatype of a
particular field. You must specify one of the parameters. If you
specify both, the -id parameter is ignore in favor of the -name
parameer. Eventually, it will obey the VUI you specified.
<P>
<DT><A NAME="create"><B>create()</B></A>
<PRE>
$id = $f->create(-values => { field1 => value1, ... });
</PRE>
This function allows you to create a new entry in this form. You can
specify field name to field value mappings with out regard for the
field ID or enumeration types. Behind the scenes magic occurs to hide
this from you. <P>
Eventually, it will obey the VUI you specified.
<P>
In order to create an entry with an attachment, you should use the
following format:
<PRE>
$id = $f->create(-values => {
"Attachment Field Name" => { file => scalar filename,
OR
buffer => scalar,
AND
size => scalar
}
});
</PRE>
Note that the size field must correspond to either the length of the
in-core buffer or the size of the file you wish to attach. Specifying
and incorrect length will result in a truncated attachment. See the
<code>t/entry.t</code> file in the source distribution for an example
of adding attachments to records.
<P>
<DT><A NAME="delete"><B>delete()</B></A>
<PRE>
$f->delete(-entry => scalar string);
</PRE>
This method will delete a given entry from the form. It does not "pad
out" the entry id for you currently. So if there are leading zeros, you
must add them.
<P>
<DT><A NAME="set"><B>set()</B></A>
<PRE>
$f->set(-entry => scalar string,
-gettime => scalar timestamp,
-value => { field1 => value1, ...});
</PRE>
This method allows you to set the field values of an existing entry. It
currently does not obey the VUI setting. You may specify the
enumeration field text instead of the enumeration value. In the future,
you will have the option of specifying either.
<P>
<DT><A NAME="merge"><B>merge()</B></A>
( run in 0.640 second using v1.01-cache-2.11-cpan-39bf76dae61 )