Versions Compared

Key

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

...

  1. if (form.load) - this implies that the rule will execute when the form first loads.
  2. eval ('x=' + http.get('http://localhost:8082/database/BIRT/allCustomers')) - this causes an HTTP GET to be issued to the indicated URL. When invoked in the context of a rule, the media type is automatically set to JSON. As we saw above, the database connector will return the list of customers as a JSON object.

    Info

    If using For the Standalone Database Connector with  Cloud, replace localhost:8082 with "app.frevvo.com" in the URL.


  3. The rest of the rule is just JavaScript. We create an array of options in the format value=label (e.g. 242=Alpha Cognac) from the data returned in the JSON.
  4. Finally, we set the options of the dropdown to the array of options using the name we chose earlier (sc).

...