Forum Discussion
Good Morning Chayce,
Here's what I've put together so far and I'm getting an error of "a variable declaration must end with a semi-colon."
var text url = If([Any Requests] = null,
URLRoot() & "db/" & [_DBID_REQUESTED_CHANGES] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([QB Unique Field])& "&z=" & Rurl(), //if no requests already, add request
URLRoot() & "db/" & [_DBID_REQUESTED_CHANGES] & "?a=s&query={%2710%27.TV.%27" & URLEncode([QB Unique Field]) & "%27}&opts=disprec" & "&apptoken=xxxx" & "&z=" & Rurl() //if already a request, edit request
); //if no requests already, add request
var text button = "<a href='" & $url & "' class='Vibrant SaveBeforeNavigating' style='background: " & if([Any Requests] = null, "#81c6e3") & "'>" & if([Any Requests] = null, "REQUEST CHANGE") & "</a>"
------------------------------
Aidon Olligschlager |
Flight Operations Technical Support
Pentastar Aviation
Waterford MI
aolligschlager@pentastaraviation.com | 248-202-9587
------------------------------
It looks like you're not closing out the variable button and actually declaring it. See if this works:
var text url = If([Any Requests] = null,
URLRoot() & "db/" & [_DBID_REQUESTED_CHANGES] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([QB Unique Field])& "&z=" & Rurl(), //if no requests already, add request
URLRoot() & "db/" & [_DBID_REQUESTED_CHANGES] & "?a=s&query={%2710%27.TV.%27" & URLEncode([QB Unique Field]) & "%27}&opts=disprec" & "&apptoken=xxxx" & "&z=" & Rurl() //if already a request, edit request
); //if no requests already, add request
var text button = "<a href='" & $url & "' class='Vibrant SaveBeforeNavigating' style='background: " & if([Any Requests] = null, "#81c6e3") & "'>" & if([Any Requests] = null, "REQUEST CHANGE") & "</a>";
$button
------------------------------
Chayce Duncan
------------------------------
- AidonOlligschla10 months agoQrew Cadet
Ah, I see it now. That worked. Thanks!
------------------------------
Aidon Olligschlager |
Flight Operations Technical Support
Pentastar Aviation
Waterford MI
aolligschlager@pentastaraviation.com | 248-202-9587
------------------------------- ChayceDuncan10 months agoQrew Captain
Just to add a bit more to it - the class Vibrant is what makes it look like other Quickbase buttons but you can override anything with CSS. Some other common things I will do with rich-text buttons include adding style for:
font-color: this is to make the font color white/black depending on the button color chosen
width: the button will adjust to the width of the text inside and sometimes I prefer to make all buttons something like 150px so that they all appear the same width up and down my report (visually a better interface)
text-decoration:none (this removes the underline/hyperlink view)
------------------------------
Chayce Duncan
------------------------------