This is a migrated thread and some comments may be shown as answers.

The expression contains object 'Fields' that is not defined in the current context

5 Answers 3784 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arthur
Top achievements
Rank 1
Veteran
Iron
Arthur asked on 21 Jul 2017, 10:33 PM

Hi

I've got an issue with Conditional Formatting. I get "The expression contains object 'Fields' that is not defined in the current context".

I've seen some errors on this forum with named fields not being defined, due to a a problem with the Data Source. But I really can't understand what's going on here. Obviously 'Fields' is defined as my TextBoxes are being populated, this error only shows up with Conditional Formatting.

Please find the image attached for a better understanding.

Could someone help me out?

Thanks

5 Answers, 1 is accepted

Sort by
0
Arthur
Top achievements
Rank 1
Veteran
Iron
answered on 24 Jul 2017, 09:12 AM
No one?
0
Yana
Telerik team
answered on 26 Jul 2017, 02:25 PM
Hi Arthur,

Indeed, the error message indicates an issue with the textbox that has a conditional formatting rule, however it is not enough for us to find the exact reason for it.

Please check the set conditional formatting rule and if expressions are written correctly with preceding '=' sign and if compound fields' names are surrounded by square brackets[].
Also verify that the used fields are available in the used DataSource. If the fields come from a parent data scope, you can use ReportItem.DataObject.FiedName to get them.

If this does not help, I'd ask you to send us the report with some test data, so we to be able to research the case further. Please open a support ticket and attach it there.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David V
Top achievements
Rank 1
answered on 16 Aug 2019, 11:08 PM

I've seen this too, square brackets around the field does seem to solve the problem, but it was happening with fields that were NOT compound field names, in fact the report seems to be somewhat random because field names that differed by a single letter worked fine, change one letter in the field name and get the error that object Fields is not defined.

I think this is an indication that there is still a bug, and I'm using 2019 version.

0
Neli
Telerik team
answered on 21 Aug 2019, 10:24 AM
Hi David,

Basically, it is not necessary to use square brackets[] if the field is not compound. What actually do you mean with 'change one letter in the field name'?
The error may occur when the textbox is not correctly bound to the datasouce or at some moment the expression syntax was not valid, which can lead to such error. 

I suggest to open a Support ticket where you can send us the problematic report. Let us know if there are any specific instructions that we need to know in order to reproduce the error.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mark
Top achievements
Rank 1
answered on 10 Sep 2020, 02:38 PM
I want to post here that something can happen that makes one field suddenly need to add bracket [], it happened to my report, suddenly all the fields contained "Grade" for conditional formating having errors of "Fields is not defined". Adding bracket resolved the issue. Hope this post can save someone's day. I have to wake up 5:30 in the morning for this issue because I don't know what went wrong.
Tags
General Discussions
Asked by
Arthur
Top achievements
Rank 1
Veteran
Iron
Answers by
Arthur
Top achievements
Rank 1
Veteran
Iron
Yana
Telerik team
David V
Top achievements
Rank 1
Neli
Telerik team
Mark
Top achievements
Rank 1
Share this question
or