Discussions

Expand all | Collapse all

How to store values collected in a javascript prompt in a field

  • 1.  How to store values collected in a javascript prompt in a field

    Posted 12 days ago
    I created an app to allow customers to open trouble tickets. 

    Analysts review customer tickets and have the ability to assign the tickets to themselves using a magic button (f-rich text).

    Here's the formula I use:

    var text DisplayParent = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];

    If([Unassigned] = true,
    "<a href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=cfc8kgqbwxd4ydd3vsabj8vdcbe&_fid_82=1&_fid_41=In-Progress&_fid_22=" & URLEncode(User()) &
    "&rdr=" & URLRoot() & "db/" & [_DBID_CASES] & "'><img src=\"https://images.quickbase.com/si/32/060-folder_out.png\"></a>")

    I have created a Managers Dashboard and I'd like to create a new Button - when pressed by the manager he/she can select users (from an existing field) to assign the case to.

    I was thinking of adding a JavaScript Prompt, then take the selected/entered value and update to update the user field - thus assigning the case. 

    "javascript:prompt ('Who do you want to assign?')"

    Any ideas?

    ------------------------------
    Manny Pinheiro
    ------------------------------


  • 2.  RE: How to store values collected in a javascript prompt in a field

    Posted 11 days ago
    Hello Manny, 

    I am not real sure what your question is, but we will give this a shot.  Is your formula working?  I am not sure if this is the entire formula, but you have a variable that you declared and have not used and in your first href, you seem to be missing the URLRoot() & "db/".  This is where I am not sure if you are asking any ideas on why the formula is not working, or if you are just wondering if there is a better way or what you would need for the javascript. 

    According to my understanding of your needs, I do not think that javascript would be necessary.  If you have a form that collects all of the information and has a field to store who the ticket is assigned to, it would be much simpler and cleaner to create a new form in the ticket table that only has two fields.  A text in the form that says "Who do you want to assign?" and the User field that you are using to assign people to the ticket.  Then, just create a button that takes you to this form. 
    "<a href='" & URLRoot() & "db/" & DBID() & "?a=er&dfid=Numeric ID of new Form&rid=" & [Record ID#] & "'>"Assign Ticket" & "</a>"

    This button would take you to edit the record of the related ticket, but would take you to the form that would have the user field, or multi-select field, that would contain the list of users and then allow the manager to select without seeing or needing to scroll through all of the other information in the original form.  This would also avoid all the headaches and potential breakage in the future if for some odd reason JS in a form is no longer supported.  

    I hope this helps...


    ------------------------------
    Brandon Drake
    JHI Group
    Monroeville OH
    ------------------------------



  • 3.  RE: How to store values collected in a javascript prompt in a field

    Posted 11 days ago
    Brandon, 

    Thanks for this suggestion. I'll gives a shot and avoid JS. 



    Emanuel Pinheiro
    SR. Technical Consultant, PIE
    O 781-370-3782
    C 401-258-6122
    ACI Worldwide, 880 Winter St. Waltham, MA