Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section allows choices/choice values to be retrieved from a database file.

Image RemovedImage Added

Choices database file - Enter the database file to use to populate populate your options/values. When setting your database file it's not required to qualify with library name, although you can. if the library is omitted, the application job's library list will be used.

...

Choice selection criteria - This acts as a WHERE clause in an SQL statement to filter your criteria. SQL parameter markers are always specified by a question mark (?). The property "choices parameter value" can be used to provide the value for this parameter marker.

Image RemovedImage Added
This will produce an SQL statement like this:

Code Block

SELECT DISTINCT CNAME, CATID FROM CATEGP WHERE CNAME = ?

Choice parameter value - This is where the choice selection criteria value for '?' is set. This value may also be bound to a field (Rich UI only).

Image RemovedImage Added
By completing the choice parameter value we can see our statement should return only the items named "Soaps". You can have multiple "parameter value" properties, however this does require multiple choices selection criteria. These can be added by right-clicking the choices parameter value property name and selecting "Add Another Choices Parameter Value":

Image Removed     Image RemovedImage Added     Image Added

For Rich Display Files the choices parameter values would ususlly usually be bound to a field allowing dynamic SQL selection.

...

These are values returned from an auto-complete list box in a successful response from the external program:

Code Block

{    
      "success":true,
      "response":[
           new Option("Dishes and Cups","18"),
           new Option("Soaps","14")
      ]
}

...

This example is JSON information returned when the script encounters an error with an database driven auto-complete.

Code Block

{    
      success:false,
      "errorId":"-204",
      "errorText":"CATEG in *LIBL type *FILE not found.",
      "errorText2":"SQLPrepare()"
}

...

Example of the showErrors() API displaying JSON error response example:

PHP Script Example: