Discussions

Expand all | Collapse all

Formula Syntax Help

  • 1.  Formula Syntax Help

    Posted 05-09-2017 14:50
    I am trying to get this formula to work so that it changes the status field of a record to display a different section of a form (for reference purpose). So when the button is clicked, the status will change to whatever part of the form the person wants to see. But it has to be in view mode, not edit mode. I cant figure out where my syntax error is. 

    var text url = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid="&[Record ID#]&"&_fid_340="&"Initial Screening";

    "<a class='Vibrant Success' href='" db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) &"'>Initial Screening</a>"

    I keep getting "Extra characters after end of formula


  • 2.  RE: Formula Syntax Help

    Posted 05-09-2017 15:32
    So there are a few things missing and a few quotes misplaced.

    So it looks like you are hoping to edit the record, then rdr to display the record.  I'd recommend this:


    var text URLOne=URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid="&[Record ID#]&"&_fid_340="&URLEncode("Initial Screening");
    var text URLTwo=URLRoot() & "db/" & Dbid() & "?a=dr&rid="&[Record ID#];
    "<a class='Vibrant Success' href='"&$URLOne&"&rdr=" & URLEncode($URLTwo)&"'>Initial Screening</a>"

    That should do it for you, and make it easy to copy or modify when needed.


  • 3.  RE: Formula Syntax Help

    Posted 05-09-2017 15:36
    This is perfect! You the man Matt, always helping out, much appreciated!


  • 4.  RE: Formula Syntax Help

    Posted 05-09-2017 15:44
    Actually, while you are here Matt,

    another quick question 

    If(     [InitalScreenCHKBX] = true
    and
         [FormOfEnt.CHKBX] = false,"<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Initial Screening"  & "&rdr=" & URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87" & "\" ) & '>Return To Dashboard</a>",
    If(
         [FormOfEnt.CHKBX] = true
    and
         [DueDiligenceCHKBX] = false,"<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Appointment Paperwork"  & "&rdr=" & URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87" & "\" )& '>Return To Dashboard</a>",
    If(
         [DueDiligenceCHKBX] = true
    and
         [ChecklistCHKBX] = false,"<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Due Diligence"  & "&rdr=" & URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87" & "\" )& '>Return To Dashboard</a>",
    If(
         [ChecklistCHKBX] = true
    and
         [Appointed?] = false,"<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Due Diligence"  & "&rdr=" & URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87" & "\" )& '>Return To Dashboard</a>"))))

    it looks like alot, but its the same thing repeated a few times. Basically. This button returns the user to a specific dashboard. But before doing so, it changes the status field, depending on what checkbox is checked. 

    This is more of a side issue and can be placed on the back burner. But if you have some time. 

    It gives me no QuickBase errors, the button just wont show up.


  • 5.  RE: Formula Syntax Help

    Posted 05-09-2017 16:56
    Nevermind guys, I actually figured out what my mistake was, I was referencing the wrong fields haha. Oops. 


  • 6.  RE: Formula Syntax Help

    Posted 05-09-2017 17:32
    Okay so I lied, it still isn't working. It's supposed to be a conditional button but I can't figure out where the syntax error is. It won't tell me, it says it could me mismatched parenthesis or brackets, but I counted and double counted. Help?

    If(     [IScomp] = true
    and
         [APcomp] = false,"<a class='Vibrant Primary' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Initial Screening"  & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87\") & '>Return To Dashboard</a>",
    If(
         [APcomp] = true
    and
         [DDcomp] = false,"<a class='Vibrant Primary' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Appointment Paperwork"  & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87\") & '>Return To Dashboard</a>",
    If(
         [DDcomp] = true
    and
         [CLcomp] = false,"<a class='Vibrant Primary' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Due Diligence"  & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87\") & '>Return To Dashboard</a>",
    If(
         [CLcomp] = true
    and
         [Appointed?] = false,"<a class='Vibrant Primary' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=buawcnbd5pjszvdimycfs3jdpzd&_fid_340=Due Diligence"  & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=87\") & '>Return To Dashboard</a>"))))


  • 7.  RE: Formula Syntax Help

    Posted 05-09-2017 18:30
    Try this:

    Yours currently:
    eturn To Dashboard</a>"))))

    My Small change:
    eturn To Dashboard</a>", "" ))))

    I'm adding an else statement and the comma


  • 8.  RE: Formula Syntax Help

    Posted 05-09-2017 18:35
    Still no dice, good observation though! I'll have to dig into this one and maybe just restructure the formula if anything. Thanks Matt


  • 9.  RE: Formula Syntax Help

    Posted 05-10-2017 03:24
    Found it.
    When you have the rdr and showing the pagid you can't comment out the last quote.

    Yours:
    &pageid=87\") & '>Ret


    What it needs to be:
    &pageid=87") &"'>Ret

    I removed the slash ( \ ) after the 87 and added a quote ( " ) before the single quote.
    Keeping the same syntax from the above suggestion you should be good to go.


  • 10.  RE: Formula Syntax Help

    Posted 05-10-2017 13:23
    Thanks Matt! I appreciate the follow through, it works!