Forum Discussion

NickCharalambou's avatar
NickCharalambou
Qrew Cadet
8 years ago

Need to create a button that advances the selection on a Text - Multiple Choice field to the next entry.

I want to add a button to a form, which when pressed advances the selection on a Text - Multiple Choice field (fid_9)
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    What is the sequence of choices?

    Be you will want to use a case formula within a variable text url.

    Post your sequence and I can throw something together.
  • Thanks.  Had not thought of using a case formula:

    New Lead
    Qualified Lead
    Re-Instated
    Rough Cut Completed
    Comps & Valuation
    Bidding
    Contract
    Exchanged
    Completed
    Tracking
    Lost
    Dropped
    Site Allocation

    The last 4 which are in bold italics you can ignore.

  • I am struggling with this.  I have created a new field that contains the Case formula.  When I report against this it appears to work properly.  However when I try to incorporate this in the Formula URL for the button, the record does not update:


    var text url=

    URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" &

    "&rid=" & [Record ID#]&

    "&apptoken=ck3rgpbk9q5gtcjxtgiwdhkzhx9"&

    "&_fid_9=" & URLEncode([What is the next Stage]) &

    "&_fid_351=" & URLEncode([What is the next Stage]) ;


    "javascript:" &

    "$.get('" &

    $url &

    "',function(){" &

    "location.reload();"&

    "});" &

    "void(0);"

  • URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" &


    "&rid=" & [Record ID#]&


    "&apptoken=ck3rgpbk9q5gtcjxtgiwdhkzhx9"&


    "&_fid_9=" & URLEncode([What is the next Stage]) &


    "&_fid_351=" & URLEncode([What is the next Stage])


    I suggest that you just make a Formula URL of just the URL and confirm it works.


    No doubt it will have some kind of error which will be a clue.
  • <?xml version="1.0"?>

    -<qdbapi>

    <action>API_EditRecord</action>

    <errcode>0</errcode>

    <errtext>No error</errtext>

    <rid>1549</rid>

    <num_fields_changed>1</num_fields_changed>

    <update_id>1492885116781</update_id>

    </qdbapi>

  • Ok. So the URL is fine. What actually happens when you push that button? Are you saying it does not refresh the screen
  • OK. So the when I use my code, the screen refreshes, but the record is not updated.

    When I use your code, it progresses to the HTML above and when I return to the record manually it has been updated.

    So I am guessing the code I have to return me to the record is cause it to fail?

  • It seems temperamental.  I cannot see if its record specific issue or something else