Getting Server Error while hitting formula URL button.

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
When i hit a fomula URL button, then it gives me this error.

What actually is this ?

Server Error in '/db' Application.


Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>
Photo of Gaurav Sharma, Certified Builder and Expert

Posted 3 years ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,414 Points 4k badge 2x thumb
Post your formula, so we can see what your formula button is trying to do that would generate this error.
Hi Laura,

Here is the formula:

and it is only occuring when it requires both manager approval.

If(User()=[Manager 1 QuickBase User ID],

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) &"&_fid_35="&"Approved"
& "&rdr=" & URLEncode(
If(([Manager 2 Approval Status]="Not Required" or [Manager 2 Approval Status]="Approved") and ([Leave Type]="Casual / Sick" or [Leave Type]="Vacation" or [Leave Type]="Sick"),
URLRoot() & "db/" & [_DBID_ASSOCIATES] & "?a=API_EditRecord&rid=" & URLEncode ([Associate Record ID#]) &"&_fid_438="& URLEncode ([Leaves Taken]+[Duration]),
If(([Manager 2 Approval Status]="Not Required" or [Manager 2 Approval Status]="Approved") and [Leave Type]="Compensatory Off",
URLRoot() & "db/" & [_DBID_ASSOCIATES] & "?a=API_EditRecord&rid=" & URLEncode ([Associate Record ID#]) &"&_fid_446="& URLEncode ([Compensatory Offs Taken]+[Duration])
))),

If(User()=[Manager 2 QuickBase User ID],

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) &"&_fid_36="&"Approved"
& "&rdr=" & URLEncode(
If(([Manager 1 Approval Status]="Not Required" or [Manager 1 Approval Status]="Approved") and ([Leave Type]="Casual / Sick" or [Leave Type]="Vacation" or [Leave Type]="Sick"),
URLRoot() & "db/" & [_DBID_ASSOCIATES] & "?a=API_EditRecord&rid=" & URLEncode ([Associate Record ID#]) &"&_fid_438="& URLEncode ([Leaves Taken]+[Duration]),
If(([Manager 1 Approval Status]="Not Required" or [Manager 1 Approval Status]="Approved") and [Leave Type]="Compensatory Off",
URLRoot() & "db/" & [_DBID_ASSOCIATES] & "?a=API_EditRecord&rid=" & URLEncode ([Associate Record ID#]) &"&_fid_446="& URLEncode ([Compensatory Offs Taken]+[Duration])
)))))

& URLEncode("&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]))
Any update ?
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Looks like you have an extra closing parenthesis at the end of the [Manager 2 Quickbase User ID] block.  For the first block you end with ))), (3) and the second block you end with ))))) (5).  I understand you need one extra closing parenthesis to close off the entire statement, but that should leave you with )))) (4) not 5.  Or am I totally missing something? :V
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Scratch that.. You're closing both the first block and the second block in, therefore 5 is required.  

I'll look a bit more.
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Is it actually possible to redirect twice in the same formula?  I notice that you're initially approving the record then redirecting and immediately editing and making changes followed by a final redirect.  I didn't think you could redirect twice.  I can't find the error, I don't know why quickbase is shooting you this error!  I'd test it out on an app- but it seems a bit tedious to setup all the fields.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,572 Points 50k badge 2x thumb
Try changing this

& URLEncode("&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]))

To this

& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Hey Mark,

I have done that earlier but after it is giving me xml 0 error page but not redirect back to record.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,414 Points 4k badge 2x thumb
That would be because your redirect is not properly encoded.
can you please correct this ?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,572 Points 50k badge 2x thumb
.. just chiming in.
If it wuz me i would break up that complex logic into a series of formula variables, and thus get the syntax correct for each smaller formula variable.  Then it will be way easier to get the syntax correct for the IF statement in terms of the brackets required  and the URLEncoding nesting.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,414 Points 4k badge 2x thumb
The final formula, revised, and working is:



var duration mgrOneLeaveAndDuration=

If(([Manager 2 Approval Status]="Not Required" or [Manager 2 Approval Status]="Approved") and ([Leave Type]="Casual / Sick" or [Leave Type]="Vacation" or [Leave Type]="Sick"),

Sum([Leaves Taken],[Duration]),null);

var duration mgrOneCompsAndDuration=


If(([Manager 2 Approval Status]="Not Required" or [Manager 2 Approval Status]="Approved") and [Leave Type]="Compensatory Off",

Sum([Compensatory Offs Taken],[Duration]),null);



var duration mgrTwoLeaveAndDuration=


If(([Manager 1 Approval Status]="Not Required" or [Manager 1 Approval Status]="Approved") and ([Leave Type]="Casual / Sick" or [Leave Type]="Vacation" or [Leave Type]="Sick"),

Sum([Leaves Taken],[Duration]),null);

var duration mgrTwoCompsAndDuration=


If(([Manager 1 Approval Status]="Not Required" or [Manager 1 Approval Status]="Approved") and [Leave Type]="Compensatory Off",

Sum([Compensatory Offs Taken],[Duration]),null);



If(User()=[Manager 1 QuickBase User ID],


URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=b27bpnevfuexvc6ntw5xcwum62u&rid=" & URLEncode([Record ID#]) 

& "&_fid_35=" & URLEncode("Approved")

& "&rdr=" &

URLRoot() & URLEncode("db/") & [_DBID_ASSOCIATES] & 


URLEncode("?act=API_EditRecord&apptoken=b27bpnevfuexvc6ntw5xcwum62u&rid=") & URLEncode ([Associate Record ID#])

& URLEncode("&_fid_438=") & URLEncode($mgrOneLeaveAndDuration)

& URLEncode("&_fid_446=") & URLEncode($mgrOneCompsAndDuration)

& URLEncode("&rdr=") &

URLRoot() & URLEncode(URLEncode("db/")) & [_DBID_LEAVE_APPLICATIONS] & 

URLEncode(URLEncode("?a=dr&rid=")) & URLEncode(URLEncode([Record ID#]))

,

If(User()=[Manager 2 QuickBase User ID],


URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=b27bpnevfuexvc6ntw5xcwum62u&rid=" & URLEncode([Record ID#])


& "&_fid_36=" & URLEncode("Approved")

& "&rdr=" &

URLRoot() & URLEncode("db/") & [_DBID_ASSOCIATES] & 

URLEncode("?act=API_EditRecord&apptoken=b27bpnevfuexvc6ntw5xcwum62u&rid=") & URLEncode([Associate Record ID#])

& URLEncode("&_fid_438=") & URLEncode($mgrTwoLeaveAndDuration)

& URLEncode("&_fid_446=") & URLEncode($mgrTwoCompsAndDuration)

& URLEncode("&rdr=") &

URLRoot() & URLEncode(URLEncode("db/")) & [_DBID_LEAVE_APPLICATIONS] &

URLEncode(URLEncode("?a=dr&rid=")) & URLEncode(URLEncode([Record ID#]))

))
Hi Laura,

It works for me..
thanks for all your help.