Discussions

Expand all | Collapse all

Select Case and URL Button Not working/disppears

  • 1.  Select Case and URL Button Not working/disppears

    Posted 09-03-2017 19:04

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



  • 2.  RE: Select Case and URL Button Not working/disppears

    Posted 09-04-2017 03:48
    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)


  • 3.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 13:51

    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)



  • 4.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 13:53
    Each of these three lines can't be like this
    missing closing quote
     
    & "&dfid=10;

    needs to be this
     & "&dfid=10";


  • 5.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 14:28
    Thanks - that worked but the button still doesn't show up on the form or table.


  • 6.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 14:32
    The most likely cause is that the Inspection Type is not one of those three choices.  Are you super sure about that?


  • 7.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 14:51

    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



  • 8.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 15:03
    Is there any chance that you have leading or trailing spaces on those choices.


  • 9.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 19:50

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

    Thanks



  • 10.  RE: Select Case and URL Button Not working/disppears

    Posted 09-22-2017 19:56
    I was wearing my special X-Ray glasses and could see those invisible spaces from here.