Skip to main content
Question

add record using formula text field rdr syntax

  • Apr 15, 2017 7:47 PM UTC
  • 0 replies
  • 113 views

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.
This topic has been closed for replies.

Where do you want to leave the user after you add the record?

  • Author
  • Qrew Corporal
  • Apr 15, 2017 8:24 PM UTC
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>"

 

  • Author
  • Qrew Corporal
  • Apr 15, 2017 8:39 PM UTC
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.

  • Author
  • Qrew Corporal
  • Apr 15, 2017 9:13 PM UTC
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.
Mark

  • Author
  • Qrew Corporal
  • Apr 15, 2017 9:55 PM UTC
ok tks

  • Author
  • Qrew Corporal
  • Apr 15, 2017 10:27 PM UTC
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>

  • Author
  • Qrew Corporal
  • Apr 15, 2017 11:30 PM UTC
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?

Mark