Forum Discussion

GabrielFigueroa's avatar
GabrielFigueroa
Qrew Member
4 years ago

Auto select a conditional(filtered) dropdown based on selection of another dropdown

A user has to select the company to do business with from a dropdown (related Hauler table).
The Contact table is related to the Hauler table. The Contact table has multiple contact information i.e. such as Billing, Dispatch, Admin & so on.
In this application, how can the Contact be auto-selected for the Dispatch contact information whenever the Hauler is changed.
The Hauler can change depending on the agreement.
First attempt was to use JQuery to locate the Dispatch RID (using the already user selected Hauler information) then API_EditRecord to update Related_Contact field but an errcode = 2 (invalid input) & errdetail of "Sorry you can't provide both the rid & key...".
  • Gabe,

    It is a two part solution.   Build a conditional against the Related Contact so that only Contacts for the Company can be selected.

    The second part is to build a Record Picker report where you filter Contacts to show Related Contract Type =  XX where XX is the value for the Dispatch.  Then specify on the form that "Record Picker Dispatch"  or whatever you call it is to be used.

    Here is a screen shot of setting the report in a form.

    z


    You might think about expanding the logic in Record Picker for example  Contact Status = Active.  This way as Contacts come and go from the Company, your report is dynamically correct.

    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • GabrielFigueroa's avatar
      GabrielFigueroa
      Qrew Member
      Thanks for responding Don!

      I believe I've already done all that you mentioned, beforehand. The only contacts showing are only relevant to the company that was previously selected.

      Currently, the user would still have to manually select (sometimes (1) & other times (1) of several).

      What I want to do is pre-select (or automate) the selection for them, always choose the 1st one.

      I would like, once the company is selected, to have QuickBase thru either JQuery or Automations or other auto-select the value to save the User time. If there are more than (1) then they would have to choose another one other than the 1st Dispatch contact record.

      ------------------------------
      Gabe Figueroa
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Gabe,

         I believe that you were saying that if the particular company only has one contact that you want that to be preselected. 

         On the relationship where one company has many contacts, do a summary field of the number of contacts.  Also do a summary of the minimum record ID of all of the contacts. 

        Make a formula on companies called [record ID of contact if only one contact]. 

        Now the company record knows the record ID of the singleton contact if there is one.

         Look up that value down to your jobs record.  Set up a Forum rule on the form where you are choosing a contact to say 

         If the  Record ID of contact if only one contact is greater than zero

        action

         Change related contact to the value in the field record ID of contact if only one contact. 

        Make sure the field record ID of contact if only one contact is on the form even if it is hidden by a foreign rule. Form rules tend not to work if the values on which they depend or not on the form.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------