Difference between revisions of "GetRecord"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
Line 18: | Line 18: | ||
;Return:[[Result Class|<tt>Result</tt>]] object. If the return code is greater than zero, use the <tt>getParameters()</tt> method to get a [[Parameters Class|Parameters]] object with the record's fields. | ;Return:[[Result Class|<tt>Result</tt>]] object. If the return code is greater than zero, use the <tt>getParameters()</tt> method to get a [[Parameters Class|Parameters]] object with the record's fields. | ||
:For a [[Composite Record]] relationship alias, the value returned is an ArrayList of Result objects, where each item in the list is a related record, and the Result object contains the fields in that record. | |||
<noinclude> | |||
[[Category:Java API]] | [[Category:Java API]] | ||
[[Category:Record Handling]] | [[Category:Record Handling]] | ||
</noinclude> | </noinclude> |
Revision as of 00:56, 15 November 2014
Get a record, with specified fields.
- Syntax
- <syntaxhighlight lang="java" enclose="div">
Result result = Functions.getRecord(String objectName, String fields, String recordID
{, Parameters params} );
</syntaxhighlight>
- Parameters
-
- objectName
- An Object Identifier
- fields
- The fields to retrieve.
- A comma-separated list of field names (Use the REST API:field Resource to get a complete list of fields.)
- The asterisk ("*") wildcard specifies all fields.
- For related-record fields in a Composite Object, specify the alias of the related object and the field name, where the alias is defined in the Object Relationships:
- alias[.alias...].* or alias[.alias...].field
- When fetched, an alias becomes a virtual "field" that contains an array of records from the related object, where each record contains the specified field(s).
- recordID
- A Record Id.
- params
- An optional com.platform.api.Parameters object. Use it to specify the Retrieve Record Permissions Parameter, in order to find out if the user has update or delete permissions on the record.
- Return
- Result object. If the return code is greater than zero, use the getParameters() method to get a Parameters object with the record's fields.
- For a Composite Record relationship alias, the value returned is an ArrayList of Result objects, where each item in the list is a related record, and the Result object contains the fields in that record.