No announcement yet.

Change values in Select (Dropdown) onLoad

  • Filter
  • Time
  • Show
Clear All
new posts

  • Change values in Select (Dropdown) onLoad

    I have a form with a Select field (Dropdown) that is populated via a lookup from a database table.
    Based on the value of another field that is returned when the record loads "onLoad" I want to change the available options that are shown in the Select field.

    Example: Order is loaded into the form with "ReqShipMethod" as "Second", so in the "ShipMethod" Select field I only want to display the options for 2nd day, like "UPS 2Day", "Fedex Next Day", "Fedex 2nd Day", etc. These values are in a database table, but I don't mind just listing the ones I want displayed.

    Can I change the possible values for a dropdown dynamically after the form is loaded (Record is loaded) ?

  • #2
    Yes. You use the Ajax Processing part of the field's settings...

    So to make field2's dropdown's contents change based on what is chosen in field1's dropdown - you go into field1's settings and under Ajax Processing choose field2. You will then need to make field2's lookup dynamic using {field} or [global] variables.

    For example:

    I have a form with 2 "select" dropdowns - AgencyId and AgencyContactName. The first lists possible Agency company names, the second displays a list of contacts for the Agency selected in the first field.

    In AgencyID field settings it has Ajax Processing selected for AgencyContactName. And the lookup in AgencyContactName is:

    SELECT AgencyContactID, ContactName
    FROM tblagencycontacts
    WHERE AgencyID = '{AgencyID}'
    ORDER BY ContactName


    • #3
      I think that points me in the right direction. In my case I just have one dropdown, but I want its contents to change based on a value in the DB for the current record. This should get me going.



      • #4
        Its the same. Just reference with curly brackets the field in your where

        Professional Scriptcase Services
        Some Customers opinions