Formula Syntax Help

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
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"
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
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.
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
This is perfect! You the man Matt, always helping out, much appreciated!
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
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.
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Nevermind guys, I actually figured out what my mistake was, I was referencing the wrong fields haha. Oops. 
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
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>"))))
Photo of Matthew Neil

Matthew Neil

  • 31,418 Points 20k badge 2x thumb
Try this:

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

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

I'm adding an else statement and the comma
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Still no dice, good observation though! I'll have to dig into this one and maybe just restructure the formula if anything. Thanks Matt
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
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.
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Thanks Matt! I appreciate the follow through, it works!