add record using formula text field rdr syntax

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
I think I need to put rdr in this formula text button but not sure of the syntax...

"<a  class='Vibrant Success' href='" & [_DBID_ENQUIRIES] & "?a=API_AddRecord&apptoken=apptoken&_fid_10=" & [Record ID#] & "'>Make an Enquiry</a>"

It needs to continue to edit the new record.
Photo of Michael Graham | Insight Global UK

Posted 2 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Where do you want to leave the user after you add the record?
On the page with a Save Button.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Sorry, I'm not understanding which "Page", are you wanting to redisplay the page that they were on or to display the newly created record?

If you just want to land the user on the newly created record, then just suffix the URL with &disprec=1

"<a  class='Vibrant Success' href='" & [_DBID_ENQUIRIES] & "?a=API_AddRecord&apptoken=apptoken&_fid_10=" & [Record ID#] & "&disprec=1" &  "'>Make an Enquiry</a>"

 
Thats exactly what I wanted.
I was getting the XML no error page and I thought it was due to not having a redirect?  
That makes sense now...  thanks Mark.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Normally you need to redirect after an API call or else it reports back with that XML success message.  But for that particular API, they conveniently anticipated that you may want to end the API with displaying the record.  Considering that you will not know that Record ID# to display as it was not yet created, it would have been tough to rdr to display the record.
Thanks...  I spoke too soon.
I want it to be in Edit Mode so that the user can complete other fields.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
There is not a way to do that I know of.
Mark
ok tks
Im just going to ask this in another way. 

How do I change this Formula URL field to a Formula Text field.

URLRoot() & "db/" & [_DBID_ENQUIRIES] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([Record ID#])& "&z=" & Rurl()
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Well not tested, try this.

var text URL = URLRoot() & "db/" & [_DBID_ENQUIRIES] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([Record ID#])& "&z=" & Rurl();

"<a  class='Vibrant Success' href='" $URL &  "'>Make an Enquiry</a>"
There are extra characters beyond the end of the formula.


var text URL = URLRoot() & "db/" & [_DBID_ENQUIRIES] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([Record ID#])& "&z=" & Rurl();

"<a  class='Vibrant Success'href='" &$URL &  "'>Make an Enquiry</a>"

That works with an & before the $URL :)

I've been trying all sorts of combinations of this for 2 days!!   
Thanks again Mark.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Right, I was missing the &. for the $URL.    So you are Ok now?

Mark