Forum Discussion

MichaelTamoush's avatar
MichaelTamoush
Qrew Captain
5 years ago

Need assistance on URL Button Formula

I am trying to create a URL button that does the following.

1. Add a record (Gen Record Add Form)
2. Edit a different record
3. Return to specific page.

The catch - if on the add record form the user changes their mind and clicks 'cancel', it does not run step 2.

What I have below works, except even when they don't follow through with the add record, step to 2 still runs.

var text ConfirmOrder =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=xxxxxxxxxxxxxxxxxxxxxxx" &
"&_fid_30=1";

var text AddOrder =
URLRoot() & "db/bqjnntqdm?a=API_GenAddRecordForm&dfid=11"
& "&_fid_12=" & URLEncode ([Related Service Order])
& "&_fid_109=" & URLEncode ([Manufacturer])
& "&_fid_110=" & URLEncode ([Mfr. Part #]);

var text Redirect = URLRoot() & "db/" & "bpupp97bm?a=dr&rid=" & [Related Service Order];

If([Responsibility]<>"Supply Chain Mgr" and [Responsibility]<>"",
$AddOrder
& "&NExtUrL=" & URLEncode($ConfirmOrder)  //I use NextUrl because &rdr did not stop on my add record form, it flew right by it
& URLEncode("&rdr=" & URLEncode($Redirect)))

//$confirmOrder runs no matter what. How can I get it to stop if $AddOrder is canceled?

------------------------------
Mike Tamoush
------------------------------
No RepliesBe the first to reply