Select Case and URL Button Not working/disppears

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered

URL button disappears in Forms and Table with Select Case statement. It work perfectly when using this alone (URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  [Record ID#] & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=10",) in the Formula box.

Any ideas?

Formula below

Case([Inspection Type],
"FSV",URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  [Record ID#] & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=10",
"Interim Inspection",URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  [Record ID#] & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=11",
 "FSV Pre-Check",URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  [Record ID#] & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=2")

Photo of Bala Aboki

Bala Aboki

  • 130 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
I'm not 100% sure why its not working, but an easier way to structure things is to use variables.

for example.

var text URL1="google.com"
var text URL2="facebook.com"

Case([Status Field],
"Option 1", $URL1,
"Option 2", $URL2,
null)
Photo of Bala Aboki

Bala Aboki

  • 130 Points 100 badge 2x thumb

Thanks Matthew,

Tried this will variable and I am getting an syntax error (Declaration must end with a semi-Colon). Formula below.

var text URL1= URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" & URLEncode  ([Record ID#]) & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=10;
var text URL2= URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  URLEncode ([Record ID#]) & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=11;
var text URL3= URLRoot() & "db/bm2icyt3r?a=API_GenAddRecordForm&_fid_29=" &  URLEncode ([Record ID#]) & "&_fid_3="  & "&z=" & Rurl()  & "&dfid=2;


Case([Inspection Type], "FSV",$URL1,"Interim Inspection",$URL2,
 "FSV Pre-Check",$URL3, Null)

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
Each of these three lines can't be like this
missing closing quote
 
& "&dfid=10;

needs to be this
 & "&dfid=10";
Photo of Bala Aboki

Bala Aboki

  • 130 Points 100 badge 2x thumb
Thanks - that worked but the button still doesn't show up on the form or table.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
The most likely cause is that the Inspection Type is not one of those three choices.  Are you super sure about that?
Photo of Bala Aboki

Bala Aboki

  • 130 Points 100 badge 2x thumb

Inspection Type is the name of the field, and the choice are the  attributes.

Open Inspection Form is where the button should appear.

Note - I still need to expand the Case statement to include other inspection types

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 49,572 Points 20k badge 2x thumb
Is there any chance that you have leading or trailing spaces on those choices.
Photo of Bala Aboki

Bala Aboki

  • 130 Points 100 badge 2x thumb

Great - that worked. The lookup Table where the values came from had trailing spaces.

Thanks

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 49,572 Points 20k badge 2x thumb
I was wearing my special X-Ray glasses and could see those invisible spaces from here.