Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 9 Next »

This method fetches the record specified by the search argument from the file.

Parameters
  1. Search argument - A Number, String, or Array value specifying a relative record number, key value, or list of key values (array of Number/String).
  2. Don't lock (optional) - Pass Boolean true to avoid locking the record if the file is open for update/delete. If this parameter is set to Boolean false or omitted records will be locked for update/delete files.
  3. Record format name (optional) - A String value specifying the record format name.
  4. Input data structure (optional) - A Profound.js data structure reference. If specified, the referenced data structure will be populated with the record data.

Exception Handling

An Error instance will be thrown with the following properties:

  • message - The IBM i message text.
  • error - The message id.
  • help - The message help text.
Example
Retrieve record with first key key equal to 101
pjs.defineTable("myfile", { keyed: true, read: true });
myfile.getRecord(101);
if (myfile.found())
  doSomething();

RPG Equivalent

CHAIN

  • No labels