I've got some debug msgs (written via Response.Write()) that I can see when I do a "View Source" like so (within VB code):
currentYear = Year(Now)
SQLString = "Select NewBiz from MasterUnitsprojSales where CYear = " & currentYear & " and Unit = '" & Unit & "'"
adoRS = New ADODB.Recordset
adoRS.Open(SQLString, adoCon)
IsNewBusiness = TRUE 'default (if record not found)
Category = "New Business"
If Not adoRS.EOF Then
IsNewBusiness = adoRS.Fields.Item(0).Value <> 0
if Not IsNewBusiness
Category = "Existing Business"
End If
Response.Write("<!-- IsNewBusiness after NOT EOF assignment = " & CStr(IsNewBusiness) & "-->")
End If
adoRS.Close()
-and (within hmtl):
<% Response.Write("<!-- Is New Biz = " & IsNewBusiness & "-->") %>
I can see these messages when I go to the page and "View Source"
But I have other similar instances that are not being written out, such as:
If Request.Form.Item("Action") = "Save" Then
Response.Write("<!-- Made it into the Action =Save block -->")
. . .
I know this block is bring reached, because the logic in it is taking place (database inserts).
Why would the Response.Write() not always work?
It's likely that you need to add trace filters specific to the Site Guest user if you want to see your debug messages when you access your page via the custom Site.
Your system may show the Debug file on its desktop if the debug file is located in the startup folder (due to which file will be recreated on every system restart). In this scenario, removing the file from the startup folder may solve the problem.
Please check that in your visualforce page you have added the controller to the page. In debug log , please delete all the List under ‘User Trace Flag’. After creating the log , set the date and time for that particular user name.
The creation of a Debug file is a reported bug on Chromium-based browsers, especially when the browser is used to download/open PDF files. In this context, opening the PDF files with a browser that is not Chromium-based (like Firefox or Safari) or another application may solve the problem.
Is your HTML comment line being appended to other text in the Response?
If so, it might be rendered far to the right (out of sight) in your "View Source" display.
Try to insert carriage return - line feed characters before and after this text.
Response.Write(vbCrLf + "<!-- Made it into the Action =Save block -->" + vbCrLf)
If this is the problem, doing a Ctrl-F find in the "View Source" display may reveal this comment line.
Is your page reloading or redirecting after the Save? That would explain it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With