How can I add a Javascript pop-up to a URL button with other API code in it

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered
Here is the code in the button:
URLRoot()& "db/" &Dbid()&
"?a=API_EditRecord" &
"&rid=" & [Record ID#]&
"&_fid_13=1" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & [_DBID_TRAINING_RECORDS]&
"?a=API_EditRecord" &
"&rid=" & [Related Training Record]&
"&_fid_6=" & [Date]&
"&rdr=" &
URLEncode(URLRoot() & "db/" & [_DBID_TRAINING_RECORDS]&
"?a=er&rid=" &
[Related Training Record]&
"javascript:alert('Update the Certificate.')"))

You can see at the end of the code there is a little bit of JS that definitely will not work.  Does anyone know how I can add this little JS pop-up to run when the user is taken to the updated record?

Thanks,
Jake
Photo of Jake

Jake

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,964 Points 20k badge 2x thumb
I have four preliminary questions that will make my answer a lot easier for everyone to understand.

1) What is the name of the table you are putting the formula in? I called it Items in my schematic below but I want to know what you call it.

2) What is the name of _fid_13  in the Items table?

3) What is the name of _fid_6 in the Training Records table?

4) Can you confirm that there is a one to many relationship between Training Records and Items:




Training Records -< Items


In the schematic below I had to annotate the one to many relationships with "1" and "n" because there isn't a crow's foot connector available (imagine that).
Nomnoml UML Diagram Tool
http://goo.gl/uDLqvg
Photo of Jake

Jake

  • 0 Points
1. Table name is "Scheduled Training"
2. "Training Complete"
3. "Date completed"
4. Confirmed
The schematic looks correct.
Thanks for your help
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,964 Points 20k badge 2x thumb
Two more questions: what are the names for _fid_13 in Items and _fid_6 in Training Records.

This information is not essential but it will make the answer easier for everyone to understand in a general sense.
Photo of Jake

Jake

  • 0 Points
I think I had the answer to that above.  Maybe I'm misunderstanding.  fid_13 = "Training Complete" and fid_6 =  "Date completed".  The button takes the date from record 13 and places it in the related record in field 6.  That part is working correctly, but I'd like to add the JS popup when the user is redirected to the record in "Training Records" so that the pop up reads "Update Certificate".
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,964 Points 20k badge 2x thumb
Sorry I am short for time and knew I had two additional questions. What I should have asked is what are the fids for

[Date]
[Related Training Record]

I am about to travel  so you answer will probably not come till tomorrow but I do need to know the fids for these two fields.
Photo of Jake

Jake

  • 0 Points
No problem.  
[Date] = fid 6
[Related Training Record]= fid 27
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,964 Points 20k badge 2x thumb
Okay I updated the diagram and as you can see I wanted to document the names and fids of all the fields along with the table names:

http://goo.gl/3HbsE3

I am out the door ...
Photo of Matthew

Matthew

  • 60 Points
I'm also looking for an answer on how to display a pop-up message after a formula URL edits and displays a record