Forum Discussion
MichaelGraham2
9 years agoQrew Assistant Captain
This is one button that determines which Section to go to. How would I implement this using your code?
var text ImageSix = "
https://realm and DBID here/g/rd6/eg/va/Rover200-25-MGZRIcon.jpg height=35;>";var text ImageSeven = "
https:///realm and DBID here/up/bkttbjwpm/g/reg/eg/va/Rover400-45-MGZSIcon.jpg height=35;>";
var text ImageEight = "
https://realm and DBID here/up/bkttbjwpm/g/reh/eg/va/Rover600-RHIcon.jpg height=35;>";
var text ImageNine = "
https:///realm and DBID here/up/bkttbjwpm/g/rd7/eg/va/MetroIcon.jpg height=35;>";
var text ImageTen = "
https:///realm and DBID here/up/bkttbjwpm/g/reb/eg/va/Rover75-MGZTIcon.jpg height=35;>";
var text ImageEleven = "
https:///realm and DBID here/up/bkttbjwpm/g/rd5/eg/va/CityRoverICon.jpg height=35;>";
var text ImageTwelve = "
https:///realm and DBID here/up/bkttbjwpm/g/rej/eg/va/Rover800-RSIcon.jpg height=35;>";
var text ImageThirteen = "
https://realm and DBID here/up/bkttbjwpm/g/rei/eg/va/Rover800-RS-91Icon.jpg height=35;>";
var text ImageFourteen = "
https:///realm and DBID here/up/bkttbjwpm/g/rea/eg/va/MiniIcon.jpg height=35;>";
var text ImageFifteen = "
https:///realm and DBID here/up/bkttbjwpm/g/ref/eg/va/Rover200-400-XWIcon.jpg height=35;>";
var text ImageSixteen = "
https:///realm and DBID here/up/bkttbjwpm/g/ree/eg/va/Rover200-400-XW-CabIcon.jpg height=35;>";
var text ImageSeventeen = "
https:///realm and DBID here/up/bkttbjwpm/g/rd8/eg/va/MGF_MGTFIcon.jpg height=35;>";
var text ImageEighteen = "
https:///realm and DBID here/up/bkttbjwpm/g/rd9/eg/va/MGTFIcon.jpg height=35;>";
var text ImageTwentytwo = "
https://realm and DBID here/up/bkttbjwpm/g/rec/eg/va/Rover75V8-MG-ZT260Icon.jpg height=35;>";
var text URLSIX = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=6";
var text URLSEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=7";
var text URLEIGHT = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=8";
var text URLNINE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=9";
var text URLTEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=10";
var text URLELEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=11";
var text URLTWELVE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=12";
var text URLTHIRTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=13";
var text URLFOURTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=14";
var text URLFIFTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";
var text URLSIXTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";
var text URLSEVENTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=17";
var text URLEIGHTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=18";
var text URLTWENTYTWO = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=22";
If (
[Vehicle Range]=8777, "" & $ImageSix & "",
[Vehicle Range]=26318, "" & $ImageSeven & "",
[Vehicle Range]=35479,"" & $ImageEight & "",
[Vehicle Range]=50613,"" & $ImageNine & "",
[Vehicle Range]=60277,"" & $ImageTen & "",
[Vehicle Range]=65806,"" & $ImageEleven & "",
[Vehicle Range]=41989,"" & $ImageTwelve & "",
[Vehicle Range]=48657,"" & $ImageThirteen & "",
[Vehicle Range]=55462,"" & $ImageFourteen & "",
[Vehicle Range]=16519,"" & $ImageFifteen & "",
[Vehicle Range]=25447,"" & $ImageSixteen & "",
[Vehicle Range]=3,"" & $ImageSeventeen & "",
[Vehicle Range]=67803,"" & $ImageEighteen & "",
[Vehicle Range]=5549,"" & $ImageTwentytwo & ""
)
var text ImageSix = "
var text ImageEight = "
var text ImageNine = "
var text ImageTen = "
var text ImageEleven = "
var text ImageTwelve = "
var text ImageThirteen = "
var text ImageFourteen = "
var text ImageFifteen = "
var text ImageSixteen = "
var text ImageSeventeen = "
var text ImageEighteen = "
var text ImageTwentytwo = "
var text URLSIX = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=6";
var text URLSEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=7";
var text URLEIGHT = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=8";
var text URLNINE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=9";
var text URLTEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=10";
var text URLELEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=11";
var text URLTWELVE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=12";
var text URLTHIRTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=13";
var text URLFOURTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=14";
var text URLFIFTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";
var text URLSIXTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";
var text URLSEVENTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=17";
var text URLEIGHTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=18";
var text URLTWENTYTWO = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=22";
If (
[Vehicle Range]=8777, "" & $ImageSix & "",
[Vehicle Range]=26318, "" & $ImageSeven & "",
[Vehicle Range]=35479,"" & $ImageEight & "",
[Vehicle Range]=50613,"" & $ImageNine & "",
[Vehicle Range]=60277,"" & $ImageTen & "",
[Vehicle Range]=65806,"" & $ImageEleven & "",
[Vehicle Range]=41989,"" & $ImageTwelve & "",
[Vehicle Range]=48657,"" & $ImageThirteen & "",
[Vehicle Range]=55462,"" & $ImageFourteen & "",
[Vehicle Range]=16519,"" & $ImageFifteen & "",
[Vehicle Range]=25447,"" & $ImageSixteen & "",
[Vehicle Range]=3,"" & $ImageSeventeen & "",
[Vehicle Range]=67803,"" & $ImageEighteen & "",
[Vehicle Range]=5549,"" & $ImageTwentytwo & ""
)
- _anomDiebolt_9 years agoQrew EliteYou are missing my point.
Your formula evaluates for every record presumable to a different value. So when viewing a report your formula will be listed multiple times - one for each record - and presumably the button will lead to a different URL for each record.
So when you suggest that you want to put three buttons on the top of a report, what logic is involved in defining those three buttons? - MichaelGraham29 years agoQrew Assistant CaptainNo, the report will actually only show ONE of the Vehicle Ranges in each report.
But the button is on every report and will go the section based on which Vehicle Range is in the report. Does that make sense? - _anomDiebolt_9 years agoQrew EliteNope it is still confusing.
The only way some field could have a common value among all records in a report is if was included in the report's criteria (eg {fid.EX.foo}) or if there was only one record total in the report. Is that the case here? - MichaelGraham29 years agoQrew Assistant CaptainThe report is filtered by Vehicle Range.
- MichaelGraham29 years agoQrew Assistant CaptainSo in a Report ALL the vehicle ranges are the same.
- _anomDiebolt_9 years agoQrew EliteWell I would then assume that the field [Vehicle Range] is not being displayed in the report as a column because it would have a constant value throughout the entire column if it was displayed and this is the same issue you are complaining about with regard to having a column of buttons all with the same value.
To get this common value of [Vehicle Range] I would perform a query through jQuery. It would basically be the same query of the instant report but using the API and setting the clist to only return [Vehicle Range] .
So if this was the URL of the report displayed in the address bar (and accessible in script through document.location.href):
https://relam.quickbase.com/db/xxxxxxxx?a=q&qid=13
You would form this URL instead:
https:/realm.quickbase.com/db/xxxxxxxx?act=API_DoQuery&qid=13&clist=42&options=num-1
Note that the act is different, a clist is added to return only [Vehicle Range] field (fid=42 here) and return only the first record (all the records have the same [Vehicle Range] value allegedly).
Extract the value of [Vehicle Range] and wrap an if statement around the code I previously posted to determine which buttonshould be displayed. - MichaelGraham29 years agoQrew Assistant CaptainIn this LINK - Instead of a column of car buttons which go to the same place (always) I would like ONE link at the top.
https:///realm and DBID here?a=q&qid=46 - _anomDiebolt_9 years agoQrew EliteSomething like this should give you the value of [Vehicle Range] within the script:
var dbid = "bkspmi7n9"; var apptoken = "your apptoken here"; $.ajaxSetup({data: {apptoken: apptoken}}); $.get(dbid, { act: "API_DoQuery", qid: "46", clist: "159", options: "num-1" }).then(function(xml) { console.dirxml(xml); console.log("section= " + $("section", xml).text()); });
You can test it by displaying that report, filling in your apptoken, and pasting it into the console. If it works add this code to the prior script and make the needed integration, logic and parameter changes.
Beyond that contact me off-world if you need additional help. The forum is not well suited for detailed debug sessions like this and I have grander projects to work on. - MichaelGraham29 years agoQrew Assistant CaptainOK Thanks Dan
- MichaelGraham29 years agoQrew Assistant Captainoh jeez I cant edit my comments to remove the links to the realm UGH!.
This isn't a good forum platform :(