on 2023 Dec 04 3:55 PM
I want to dynamically set the field labels.
For this, I decided to use the Virtual Elements, calculated using the class and assign using the annotation EndUserText.Label.
Issue 1:
The @EndUserText only accepts string(40) data type, which does not seem possible to define due to the errors below:
Moreover, string is also not supported as the target type for CAST.
Issue 2:
To avoid created too many classes for each virtual element, I used a single class. However, when I try to reuse the class, I get the above error, which goes away when I use the class only once, or use 2 different classes. However, I have seen multiple blogs online using the same class for multiple fields. The class still does get activated, so do not know if this is really an issue.
What do you think is the best way to achieve my use case.
Best Regards
Request clarification before answering.
Hi Max,
issue 2 is a framework bug that comes up during a CDS annotation check. There will be a fix for it, but it should not hinder the CDS view activation.
Issue 1: The error could be a bit misleading. It actually means that the EndUserText.label annotation expects an annotation value of a string with 40 characters, enclosed with single quotation marks.
@EndUserText.label: 'This is a text label'
This annotation only accepts a fixed value defined during design time (no dynamic).
Regards,
Jessie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
33 | |
9 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.