Discussions

Expand all | Collapse all

Pre-populate Dropdown Field on Button click

  • 1.  Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    I have a Notes table that is related to multiple other tables.

    Each of those tables' forms have an "Add Note" button which takes me to the Note's form.

    In the Notes form, there is a Type dropdown menu, and a Subject dropdown menu.

    The Subject is conditionally based off of the Type menu.

    Is it possible to change the URL in the buttons to pre-populate the Type dropdown with the "type" corresponding to the form the link came from?

    Example:

    I am in the Jobs form, I click the "Add Note" button in the Jobs form.
    The button takes me to the Notes form where the Type is pre-populated with Job due to the Add button having been pressed in the Jobs form.

    I have the Type field in Notes already populated with the corresponding names of the different tables/forms.

    I would like it so that when I click the "Add Note" button, it pre-fills the Type with Job, or Assignment, or Work Order, or etc etc, in the Notes form, based upon in which form the Add Note button was clicked.

    The Type field in Notes id fid 34.

    My ultimate goal is to get the Type pre-populated with the name of the Form in which the "Add Note" button was clicked, whether that is via the button URL being adjusted, or some other way, it makes no difference to me.

    Thoughts?

    ------------------------------
    Andrew
    andrew.fry25@gmail.com
    ------------------------------


  • 2.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    See this response here to a similar question

    https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=c339b7c1-65fc-4250-8d33-338770cd8e37&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bmc339b7c1-65fc-4250-8d33-338770cd8e37

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



  • 3.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    Thanks Mark!! I read through the link you provided. I should have thought about that.

    I have a number of custom buttons already in my different forms for things such as Approvals, Clock in/out, etc., and by using the code in the button, I populate certain fields in the same form.

    I guess I wasn't associating the fact that I could do the same with a different table. My understanding and application of the concept stopped at doing things on the same table where the button is located, and it didn't even occur to me to use the same process across different tables.

    But it makes sense if I am already transitioning to the other table, to call out the appropriate field and have it pre-populate, which is exactly what I was looking for.

    Thanks for pointing me in the right direction!!

    ------------------------------
    Andrew
    andrew.fry25@gmail.com
    ------------------------------



  • 4.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    Hmmm, it doesn't seem to be working as I had expected.

    Here is the code from my Add Note button in the Assignments form:

    URLRoot() & "db/" & [_DBID_TABLE_1]
    & "?a=API_GenAddRecordForm&_fid_25=" & URLEncode ([Assignment ID #])
    & "&_fid_34=" & "Assignment"
    & "&z=" & Rurl()


    The field 34 in my Notes table, is a related field from the Notes Type table. It is a drop down menu. Not sure if any of that makes a difference.

    ------------------------------
    Andrew
    andrew.fry25@gmail.com
    ------------------------------



  • 5.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    The Key field on your Notes Type table is probably Record ID# and you are probably trying to populate the field called [Related Note Type], which is a numeric field.

    So just have a look at the Notes Type table to see what Record ID is for "Assignment" and then  put that number into the formula

    like

    & "&_fid_34=" & "3" // ie if Assignment rid is 3.

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



  • 6.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    Mark,

    It is like you are sitting right here looking at it!! hahaha

    I have my Types in a list within the Type field of the Note Types table. The field ID for it is 3. The field type is: Text - Multi-choice.

    When I put the 3 in the formula, due to the field ID being 3, I was confused as to how it would pull in the correct type. But I tested it.

    It gave me the 3rd item in the list. So changed it from a 3 to a 1 and it gave me what I needed.

    Thanks for the clarification Mark and pointing me in the right direction!!

    ------------------------------
    Andrew
    andrew.fry25@gmail.com
    ------------------------------



  • 7.  RE: Pre-populate Dropdown Field on Button click

    Posted 10 days ago
    OK, glad its working.

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