Forum Discussion

BalaAboki's avatar
BalaAboki
Qrew Trainee
7 years ago

Select Case and URL Button Not working/disppears

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")

9 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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)
  • 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)

  • Each of these three lines can't be like this
    missing closing quote
     
    & "&dfid=10;

    needs to be this
     & "&dfid=10";
  • Thanks - that worked but the button still doesn't show up on the form or table.
  • The most likely cause is that the Inspection Type is not one of those three choices.  Are you super sure about that?
  • 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

    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Is there any chance that you have leading or trailing spaces on those choices.
    • BalaAboki's avatar
      BalaAboki
      Qrew Trainee

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

      Thanks

    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I was wearing my special X-Ray glasses and could see those invisible spaces from here.