pop up window button to edit field

  • 1
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a formula URL button that does the following when pressed:

1) Update 2  fields in the same record then 

2) Redirect to the record.

I want to add a second feature here:  when I click the button, I want a pop up window to allow me to give an explanation as to why I clicked the button.  when I fill that out, the record saves.

Use case:  button is to change the status of a job to "suspended" - so i want to give a reason for suspending the job after I press the button.

This is my code currently:

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

"&rid=" & [Job Number]&

"&apptoken= xxxxxxxxxxxxxx"&

"&_fid_40=Work in Progress&_fid_102=Suspended" & 

"&rdr=" & 

URLEncode(URLRoot() & "db/" & Dbid() & 

"?a=dr&rid=" & [Job Number])
Photo of Geoffrey

Geoffrey

  • 1,820 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,158 Points 50k badge 2x thumb
Here is my low tech solution.

Make a super mini input for with basically just the field that needs to updated with the reason.


Let's say it turns out to be form ID# 10

Then just replace the last part of your redirect like this

"&rdr=" & 

URLEncode(URLRoot() & "db/" & Dbid() & 

"?a=er&dfid=10&rid=" & [Job Number])



so its not a fancy pop up, but just leave the user at an Edit Record form with just the field that needs to be updated.
Photo of Geoffrey

Geoffrey

  • 1,820 Points 1k badge 2x thumb
Ok so this worked somewhat.  I basically applied that exact same formula, except I built in a dynamic form rule that states:  If the status changes, then the "field that needs to be updated" is shown and required.  
So essentially, the button changes the status, then re-directs back to the form in edit mode.  The user then has to complete the  field otherwise he cant save.

Would like a pop-up, but this is a good work around and does the job
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,158 Points 50k badge 2x thumb
Hmmm, How are you able to cause a field to be required when another field "changes"
Photo of Geoffrey

Geoffrey

  • 1,820 Points 1k badge 2x thumb
I don't know :)  but it works for some reason.  Maybe I stumbled upon a bug by mistake
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,158 Points 50k badge 2x thumb
How does your form rule read?
Photo of Geoffrey

Geoffrey

  • 1,820 Points 1k badge 2x thumb
When [job status] is equal to cancelled. action: show [cancelled reason] and require [cancelled reason]