RobinKautz
9 years agoQrew Trainee
How do I get two URL's to work with a single button click
I have two URL's that I am trying to get to work within a URL formula button AND with one click of that button AND to redirect back to the original record, but I am having trouble. The button is located within the records of the Opportunities Table.
URLONE activates a code page which checks a box for every record in a child table of Opportunities called Activities that is not already checked. Once complete, the code page currently redirects to a report in the Activities Table, but I can alter that if I need to.
URLTWO takes me to the Project Table form which has a reverse relationship with Opportunities and auto fills in a few of the fields. I then fill in a few other fields and hit save. After the project record is saved it redirects back to that same record in the Opportunities Table.
I can get it to perform one URL or the other, but not both, and certainly not both with a single button click. Nor can I get it to do both and redirect back to the original Opportunity record. Here is the URL: (This button is located within the Opportunity Table)
var text URLONE = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageid=94";
var text URLTWO = URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_GenAddRecordForm&_fid_270=" & URLEncode ([Record ID#])&
"&_fid_75=" & URLEncode ([Related Company]) &
"&_fid_242=" & URLEncode ([Opportunity Name]) &
"&z=" & Rurl();
If(([Stage]="Won" or [Has Billable Work Started Yet?]="Yes") and [# of Projects]=0,
$URLONE
& "&rdr=" & URLEncode($URLTWO),
"")
URLONE activates a code page which checks a box for every record in a child table of Opportunities called Activities that is not already checked. Once complete, the code page currently redirects to a report in the Activities Table, but I can alter that if I need to.
URLTWO takes me to the Project Table form which has a reverse relationship with Opportunities and auto fills in a few of the fields. I then fill in a few other fields and hit save. After the project record is saved it redirects back to that same record in the Opportunities Table.
I can get it to perform one URL or the other, but not both, and certainly not both with a single button click. Nor can I get it to do both and redirect back to the original Opportunity record. Here is the URL: (This button is located within the Opportunity Table)
var text URLONE = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageid=94";
var text URLTWO = URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_GenAddRecordForm&_fid_270=" & URLEncode ([Record ID#])&
"&_fid_75=" & URLEncode ([Related Company]) &
"&_fid_242=" & URLEncode ([Opportunity Name]) &
"&z=" & Rurl();
If(([Stage]="Won" or [Has Billable Work Started Yet?]="Yes") and [# of Projects]=0,
$URLONE
& "&rdr=" & URLEncode($URLTWO),
"")