I try to use the custom code function in SSRS (SQL Server Reporting Services), but keep getting the message "Unrecognized identifier" in the expression editor.
Here is my code. In fact, the final procedure will be more complicated than this, but I am trying to simplify things to find out why the error occurs.
Public Function GetCutoffDate(batchNumber As String) As DateTime
Return New DateTime(Now.Year, 12, 31)
End Function
This is how I refer to the code in the expression editor.
=IIf(UCase(Fields!MailId.Value) = "VARIOUS",
Code.GetCutoffDate(Fields!BatchNumber.Value),
Fields!CutOffDate.Value)
I get a red underline in the "GetCutoffDate" section of Code.GetCutoffDate (..). Also, the “Unrecognized identifier” message appears when I hover over the text “GetCutoffDate”.
What am I missing?
Expression, "Unrecognized identifier" .
=Code.GetCutoffDate(Fiels!BatchNumber.Value)
- , , .
.