Formula URL - Edit then Add
Hello Everyone,
I'm trying to create a single button that will allow our users to add an effective end date to a record on form ID 11 and then when that is saved redirect to the add record api using form ID 10 populated with data from the previous record. Since I haven't been able to get it to work in a single button I created 2 buttons. Indivually both buttons work but combining them isn't. Any ideas?
Step 1 code:
URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#] &"&dfid=11" & "&rdr="
Step 2 code:
URLRoot() & "db/" & Dbid() & "?act=API_GenAddRecordForm&dfid=10" & "&_fid_6=" & [Paragraph] & "&_fid_7=" & [Publication] & "&_fid_8=" & [Description] & "&_fid_11=" & URLEncode([Staff Contact]) & "&_fid_17=" & [Effective End Date] & "&_fid_19=" & [Record ID#]
When I combine the code I'm using this
URLRoot() & "db\n/" & Dbid() & "?a=er&rid=" & [Record ID#]
&"&dfid=11"
& "&rdr="
&URLEncode(URLRoot() & "db/" & Dbid() & "?act=API_GenAddRecordForm&dfid=10"
& "&_fid_6=" & [Paragraph]
& "&_fid_7=" & [Publication]
& "&_fid_8=" & [Description]
& "&_fid_11=" & URLEncode([Staff Contact])
& "&_fid_17=" & [Effective End Date]
& "&_fid_19=" & [Record ID#])
I feel like I need a pause before the & "&rdr=" in the third line as I get an error saying something went wrong.
For now I will keep it 2 separate buttons but it would be great to combine them and using the save function on the edit record to trigger the second step.
Try this
URLRoot() & "db\" & Dbid() & "?a=er&rid=" & [Record ID#]
&"&dfid=11"
& "&NextURL="
&URLEncode(URLRoot() & "db/" & Dbid() & "?act=API_GenAddRecordForm&dfid=10"
& "&_fid_6=" & [Paragraph]
& "&_fid_7=" & [Publication]
& "&_fid_8=" & [Description]
& "&_fid_11=" & URLEncode([Staff Contact])
& "&_fid_17=" & [Effective End Date]
& "&_fid_19=" & [Record ID#])Marks answer should work, but I just wanted to add that this will only work on desktop version, as $NextURL does not function on mobile, so just be careful of that.