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

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
I want to add a button to a form, which when pressed advances the selection on a Text - Multiple Choice field (fid_9)
Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb
  • confused

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
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.
Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb

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.

Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb

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);"

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
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.
(Edited)
Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb
Sorry the HTML.  Can seem to paste the error with the HTML
Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb

<?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>

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Ok. So the URL is fine. What actually happens when you push that button? Are you saying it does not refresh the screen
Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb

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?

Photo of Nick

Nick

  • 150 Points 100 badge 2x thumb
It seems temperamental.  I cannot see if its record specific issue or something else
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Can I see your current formula. I guess you in fact have two different buttons.
(Edited)