How can you create a single button to trigger four url formula buttons

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have four URL formula buttons that trigger code to run Exact Form code to create four indivdual documents. I need a single button to run these but I am finding that it stops after running the first button. I need someway to loop the code from one button to the next.

This is the code that I have right now

var text URLONE = [Create Refrigeration Quote];

var text URLTWO = [Create Refrigeration Parts Order];

var text URLTHREE = [Create Refresh Job Opening];

var text URLFOUR = [Create Refrigeration SOW];

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

 

$URLONE

& "&rdr=" & URLEncode($URLTWO)

& URLEncode("&rdr=" & URLEncode($URLTHREE))

& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))



//& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
Photo of Joey Zint

Joey Zint

  • 1,708 Points 1k badge 2x thumb

Posted 2 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
Your syntax is correct.  Can I see what some of those URL field Formulas are?
Photo of Joey Zint

Joey Zint

  • 1,708 Points 1k badge 2x thumb
So the issue is that this code is processing through an external server/service so one button needs to fire and process before the other one starts. I think I need some type of timer to run through each button independently and pause for a few seconds before the other one fires

"https://www.quickbaseutilities1.com/HussmannServices_1020/DocumentMerge/doc_merge_UA.aspx?"
& "clientid=Q1020"
& "&appid=bkwi6tan3"
& "&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]
& "&tpid=10"
& "&fn="&[Store Number]&"-Aldi Refrigeration Parts Quote (Aldi)-"&Today()
& "&msid=" & URLEncode ([Record ID#])
& "&msdb=" & Dbid()
& "&faid=986&efpdte=1916"
& "&addfiles="
& "&docfmt=pdf&stream=y"
& "&apptoken=dwnt9wipc3cvfcg6nvd3ba97ps4"
Photo of Joey Zint

Joey Zint

  • 1,708 Points 1k badge 2x thumb
This code is from button one....all of them are pretty much identical except where the file name, file attachment and date field changes
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
That is not going to work.  You will need to contact Juiced  to see if they can write a script for you.  Note that each time you run that Juiced EF+ button there is a pop up window with a progress bar, so that is not compatible with linking the button together.
Photo of Joey Zint

Joey Zint

  • 1,708 Points 1k badge 2x thumb
Yeah that is what I figured....they do have a batch process feature for this that I was really not aware of when I had them set up the Exact Forms....thanks for taking a look
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
>So the issue is that this code is processing through an external server/service so one button needs to fire and process before the other one starts.

I don't see why this would be true. If the generation of one document does not depend on the previous document being generated first you should be able to open each URL essentially simultaneously. Certainly the external server can support four simultaneous requests. I think you are being led into this thinking because you are relying on the rdr parameter which perforce uses a sequential synchronous process. If you used script you could launch each of these URLs essentially simultaneously and display the response (including a progress bar) in its own window as that response was made available.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
I agree.  The Juiced servers are cloud based and can support multiple simulaneous calls.

Alas, if I only knew script :)

Mark
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
>Alas, if I only knew script :)

Well I have a training program I could sign you up for. It is loosely based on the theme in George Bernard Shaw's play Pygmalion where a couple of English gentlemen wager each other that one can't turn a common flower girl into a proper duchess. My training program can transform a QuickBase commoner into script wielding ninja.

My Fair Lady - The Rain In Spain
https://www.youtube.com/watch?v=uVmU3iANbgk
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
Very entertaining video.  Now I will have a smile  for the rest of the day.
Photo of Joey Zint

Joey Zint

  • 1,708 Points 1k badge 2x thumb
@ dandiebolt....I am with you. If I can press four buttons at the same time, not sure why code could not be written to process each button in sequence...either by delay through a timer or through an array. I myself am not a coder. I know just enough to be dangerous and to make me mad because I cannot figure it out or only get it working halfway.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
It is easy - I will give you an example when I am through slacking off.
Photo of Keith

Keith, Champion

  • 1,096 Points 1k badge 2x thumb
I'd like to point out one thing from Marks comment above...there are 2 options for EF+, one shows a popup and progress bar as Mark pointed out but another option we offer will create and open the document in the browser without a popup progress bar displaying.  
more here:  http://qbtools.helpdocsonline.com/features-and-functionality  see User Experience section

also, as Joey mentioned our EF+ batch processor will handle creating multiple documents with a single button click.