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
Where do you want to leave the user after you add the record?
On the page with a Save Button.
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.
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.
There is not a way to do that I know of.
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()
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.
Right, I was missing the &. for the $URL.    So you are Ok now?