Is there an API call I can put into a Formula URL To allow me edit record with a different form?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
The issue I am having is that I am using GenAddRecordForm and specifying the form, but this creates a duplicate record. Any way of just editing the record in a different form?

Here is my current formula, everything works except the fact that its adding a record instead of editing in a different form

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &    "&rid=" & [Record ID#] &
    "&apptoken=buawcnbd5pjszvdimycfs3jdpzd" &
    "&_fid_313=Assigned" &
    "&rdr=" &

URLEncode(URLRoot() & "db/"  & Dbid() & "?a=API_GenAddRecordForm&dfid=2&_fid_260=" & URLEncode ([Agency Name])& 

"&_fid_57=" & URLEncode (User())&
"&_fid=313=" & URLEncode ("Assigned")&

"&z=" & Rurl())
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
So you want to just go to the existing record in Edit mode?
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
I mean, yes, thats the end goal. But to a specific form (not the one that the report is set to go to by default, but I cant change it base on role because every role needs to be able to edit that record in various forms)
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
You'll want to redirect them back to edit mode, but if the form needs to be role specific, do not specify the form in the button, but rather use the settings for the forms to designate the roles and usage.


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

You can access the form setting from the table settings > Forms > 
Photo of Michael Armstrong

Michael Armstrong

  • 212 Points 100 badge 2x thumb
So from my understanding you are trying to edit the same record you just saved I think by using the "rdr" so I can make a modification there. If you want to pull up the normal QB UI for an edit form you can specify it like this:
URLEncode("&rdr=" & URLEncode(URLRoot() & "db/"  & Dbid() 
& "?a=er"
& "&dfid=FormID"
& "&rid=" & [Record ID#])
You just can't specify field values to show up in the fields using "er", but you can specify all the field values in the first call and then display the record using the url above. 
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Sorry, I might have explained it improperly.  I can't have it be role specific. I need it to be done via the button. And its all withing one table. There is only one table actually. 

Basically it has to direct them to edit the record, in a specific form, with certain fields prefilled (the ones in my original formula, but I could add those in myself
Photo of Michael Armstrong

Michael Armstrong

  • 212 Points 100 badge 2x thumb
If your form is specific to these types of edits, meaning it's only used by this button, you could direct them to the page with the url I specified above (a=er&dfid=...etc) and then use form rules to set the desired field values. Since it looks like you're using hard data or "current user" you can set in form rules.

Ie. If "field 57" is empty set the field to "current user"
And
If "field 313" is empty or not Assigned set to the value "Assigned".

It would look and feel like the fields were auto populated and ensure they are set to the right value even through to saving. It just doesn't work in a grid edit fashion, but that doesn't seem to be used in this workflow.
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
This and your previous comment got me through it, thank you!!