AndreonnaGarret
8 years agoQrew Assistant Captain
Formula Text Button that opens in a new tab
I have a formula text button that I need to open a child record in a new tab when clicked. Can someone please help me out?
My formula is:
var text rdr = URLRoot() & "db/" & [_DBID_ASSETS] & "?a=API_GenAddRecordForm"&
"&_fid_112=" & URLEncode ("Part") &
"&_fid_162=" & [Sales Order #] &
"&_fid_338=" & URLEncode ([Record ID#]) &
"&_fid_14=" & URLEncode ([Related Part Assignment]);
var text url =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=biyf682cpfpeqfbfpv8pida6k3gy" &
"&_fid_142=true"&
"&_fid_101=" &Now();
If(IsNull([Exchange Received])=false and [Line Type]="Part" and [Type]="Exchange",
"<a class=\"Vibrant Primary\" href=\"javascript:" & "$.get('" & $url &
"', function(){" & "window.location.href ='" & $rdr & "';" & "});" &
"void(0);\">Receive Exchange</a>",
If([Exchange Received]=true and [Line Type]="Part" and [Type]="Exchange",
"<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
"', function(){" & "location.reload();" & "});" &
"void(0);\">Exchange Received</a>"
))
My formula is:
var text rdr = URLRoot() & "db/" & [_DBID_ASSETS] & "?a=API_GenAddRecordForm"&
"&_fid_112=" & URLEncode ("Part") &
"&_fid_162=" & [Sales Order #] &
"&_fid_338=" & URLEncode ([Record ID#]) &
"&_fid_14=" & URLEncode ([Related Part Assignment]);
var text url =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=biyf682cpfpeqfbfpv8pida6k3gy" &
"&_fid_142=true"&
"&_fid_101=" &Now();
If(IsNull([Exchange Received])=false and [Line Type]="Part" and [Type]="Exchange",
"<a class=\"Vibrant Primary\" href=\"javascript:" & "$.get('" & $url &
"', function(){" & "window.location.href ='" & $rdr & "';" & "});" &
"void(0);\">Receive Exchange</a>",
If([Exchange Received]=true and [Line Type]="Part" and [Type]="Exchange",
"<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
"', function(){" & "location.reload();" & "});" &
"void(0);\">Exchange Received</a>"
))