"Add Record" button redirecting after saving in mobile... when it's not supposed to?

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • In Progress
When a user creates an order, they need to stay on that page to add another record related to an order.  This has always worked fine on the PC, but for some reason our mobile version has been returning people to the previous page after they save the order:

URLRoot() & "db/" & [_DBID_ORDERS] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Club Name])


It definitely does not have the & "&z=" & Rurl()  added to the end.  I'm not sure if there's any way to fix this by using a different link or form for mobile users?  I appreciate any help or insights.
Photo of Caitlyn

Caitlyn

  • 506 Points 500 badge 2x thumb

Posted 1 month ago

  • 0
  • 1
You could try using the NextURL at the end of your formula such as:

& "&NextURL="  & URLEncode(URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#])

However, I have heard from others of odd behavior with their buttons on mobile, but it's worth a shot.

-Sharon
(Edited)
Photo of Caitlyn

Caitlyn

  • 506 Points 500 badge 2x thumb
Thanks Sharon.  Any way to find the record ID of the newly created record?
I'm not sure what you mean by 'find'. The record ID will be at the top of the record unless you're using a different title. It will also be in the [Record ID#] field.
Photo of Caitlyn

Caitlyn

  • 506 Points 500 badge 2x thumb
The formula you included sends me somewhere else, and I needed to have the new record ID to keep me on the new record I created.  I was able to play around with it a few hours ago, and managed to make it work on iPhone but not Android.

URLRoot() & "db/" & [_DBID_ORDERS] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Club Name])& "&NextURL="  & URLEncode(URLRoot() & "db/" & [_DBID_ORDERS])& "a=dr&rid=API_DoQuery&RIDs=1&query={'1'.AF.Now()-Minutes(2)}AND{'5'.CT.User()}AND{'17'.CT.[Club Name])&clist=3\noptions=num-1"

I'm very limited with URL coding, but that's what I have if anyone is looking up this issue.

Thanks Sharon.
Wow! I'm impressed that's a really creative way to find the last record created.

Help me understand the relationship you have better. You wrote: "When a user creates an order, they need to stay on that page to add another record related to an order."

From this, it sounds like Orders are the parent record, and you would like for users to stay on that record after they create a child record related to it. Is that right?

Or are you saying you want them to 'save and keep working' on the child record?