SAP CAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
qmacro
Developer Advocate
Developer Advocate
1,551

Among the CDS annotations for declaring constraints when modelling, there are a handful that can be used to drive behaviour and restrictions in Fiori UIs, by causing the generation of appropriate annotations in the service's metadata.

One of these annotations is @mandatory, and this causes an OData annotation to be generated on the target that corresponds to the element annotated in CDS:

<Annotations Target="...">
  <Annotation Term="..." EnumMember="..." />
</Annotations>

The OData vocabulary Common contains the term FieldControl. In the <Annotation ... /> element that is generated, there's an attribute Term which points to this term, and a second attribute EnumMember which contains the fully qualified value for that term, a value which represents "mandatory".

What is that fully qualified value?

This is a question from the June Developer Challenge on CAP Knowledge. And don't forget: always submit your answer as a hash, on its own - read the Taking part section of the intro post for more info. At the end of today, this question will be updated with links to further reading on this topic.

Further info:

48 Comments
VishnAndr
Active Contributor
0 Likes

4261693c903b5b3420ee2fc3e02ce513ea93a8b724afb666f3d39d49f80c2409

kasch-code
Participant
0 Likes

d1c6dc3547fbbddf6a9ad80320888e9f941a64a158933b76f028e4d61de7627c

furkan5
Explorer
0 Likes

3173672c530481aa821428d68bf8ab42f6ecbd6d0681a5538505362324f20112 

Chaimae_Chairi27
Participant
0 Likes

2421d076bc99d2ac1261b17285ddbc50d2ce3237f85e97478413d035cc2f56e2

aelghannam
Participant

e5eef203e60b54408ae444da7e6c61535bbb7173fd8ff7ede092cf190d4ded88

Henning
Participant

5229e4933c939dea621822aaaa8532f9558fd7dbdc5ec22aae317307277b65b5

HarshPatelV
Participant

Nice challenge! It’s always fascinating to see how CDS annotations are translated into OData metadata and ultimately influence Fiori UI behavior. Definitely a good exercise for CAP developers. 👍

SachinArtani
Active Participant
0 Likes

1068918fbea4fce9331eb8d31e1de5c3bc9a5bd7c79e862678c52e7b452c7639

Mayank_Mittal8
Explorer
0 Likes

7e5851a97d7729bc77cc38ce88c1fce760292028b1a2b3468ec5b848e3fa1577

RajeshOlive
Explorer
0 Likes

1e21a7e93d90c2d1789c5d3759e0bb92244c3f049badaef648a5ed6c05b442bc

ajmaradiaga
Developer Advocate
Developer Advocate
0 Likes

31b9f7aef6e2ce16fa041961618c535bd3f061c01dd23af02b1cf6677637528d

qmacro
Developer Advocate
Developer Advocate
0 Likes

Thanks @HarshPatelV ! I agree, I always like to understand what's going on under the surface. That way I can appreciate even more the calmness _above_ the surface 🙂

mvaibhav
Contributor
0 Likes

8acaea67cbb0e6de93334902cbef8460aa36d1a7e88444774ea52372b3d6cf8f

0 Likes

6ea9252bbd352648d1b1e4bbb26f8d18c4e919f690c2702e9d7ff9d07757571f

sarvesh_agarwal
Explorer
0 Likes

adc18a83ba5efb3f45990c027636e0bde5b636b87088ceab8ec05c14f154176b

AfshanAnsari
Explorer
0 Likes

9a4e85b66487e276dda213d631cf1ff983baf1d2bb97944ab33d0bdf5d831bea

berkaydurmaz
Explorer
0 Likes

53ab923585aa284d20c016d60110bacd249850eb6f01cc3c5fe88839b3e9b6a1

tchaitanya
Explorer
0 Likes

16ce30f6ab94d08dc70c4420bc5400ee6b8eaa4dd4427a3a5f64489c9d499d61

Rupesh_Kumar25
Explorer
0 Likes

985f2606936619af15f6061d04e657c1d1816a4bdd99825454ba3deed7a5ca86

Joery
Participant
0 Likes

3013c82e91628a2e00eae270515fe31770b959f60d65477b0fc650c529782901

MioYasutake
SAP Champion
SAP Champion
0 Likes

885f7ce73e201ef75095eabf0beee569fc8b75194909d44abba0201d7aaa11f6

SyamsundarKarukola
Discoverer
0 Likes

8088f552d54fb76c3b44971f7cca5ac137cbb5355ebf519364b3a2439e6e77f7

shotokka
Explorer
0 Likes

7e897afe266d49f9266da3d3a685299fb7f7c6fcba86bc4368c8f59e028ade57

soisses
Explorer
0 Likes

994d691e7d40e50f55967bde6979b75c4534d56e283433af9d0f6ec85938ca02

PrabhuDC
Explorer
0 Likes

d2b5b916aafb972d0bdbbf44304e4481634dcff8bcaa37fad31d1fa99611a976

NakulG
Explorer
0 Likes

81048fb44b36ed7d6f12df5949692bb4b1704d42c01eeb950ce2119a224b3954

satya01
Product and Topic Expert
Product and Topic Expert
0 Likes

03448ddc1aafab20637e0ef9f4d2dfb4cdfc6ca70936f0e5d19ac913988fbd34

ditt_kalyan
Explorer
0 Likes

95011f7111efd8dee4591106f9338c2c09b29ecd325fd89a588bb43a3dff4dc3

SergioG_TX
SAP Champion
SAP Champion
0 Likes

d3483321b216ee9a2ccc423803a92161b7d9340d5a55f674e92d7168a6e9548c

MatLakaemper
Participant
0 Likes

16246a890e59cb3ac3a63bdd5afbb025d08026876ed426ff48cbd94f67e948d4

JFenris
Explorer
0 Likes

115bde6a99a79e422f30c867af38ab4bd1244d5acae43e32a5d842078ee4f14e

ankitsrivastav
Explorer
0 Likes

a77a74086db22330f5da3fc229ead5251d9ada8b96b667f872d78b60b31ccd45

lidavidlee
Explorer
0 Likes

2f307500e74ca1453ccbb43d82dc456e751af9766c4c2511ad94824d444e6eb4

omer_sakar
Active Participant
0 Likes

bdb83c033889e783418aaf4cc06b459b8e5ed4b1653888671ed06f0502bf1766

aryan-11
Explorer
0 Likes

05933f6e0155559dae41d269fcf8325e13ab464d2254964833e25e30c4493e87

tobiasz_h
Active Participant
0 Likes

f930e40772c8acb457c76e3deb9d3fe5217515efe24cc418a2db827bf4855507

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Likes

7b6bf1479daf6e0c5a926c54dfa9d8bc58355f10cf75d52272cac323c0b56a05

parthasaradhi
Explorer
0 Likes

a04122ea6308dbd0beff773bea244d5456b622d4d86f8ab94acc81d8135e9297

NeelimaEmmani
Explorer
0 Likes

4c57c211f43c28efe503f3d4713489d646c2c1e1291336888e6e1db7e17e7e22

soheil_st
Explorer
0 Likes

10ad6e0fd300171b6edc7a4e777a415894dd31ce7a475750b4dd5add8054c3fb

Andrii
Participant
0 Likes

4fb051787b610e296c7512541b1fb5435fd363a8ca75bdf402dbdf095b15f439

nagarjundas_1994
Explorer
0 Likes

a42d0fa13b90bbf65c637d9f622e6c2438ac43e701e93c280094c6bba4343dde

YLN
Explorer
0 Likes

5a6c0130db095fa22cd802f4dadb5c4a829e9ce5a716fd15dd17701ba937e5f3

GauravPhadnis
Product and Topic Expert
Product and Topic Expert
0 Likes

2a1deaf5b332f3e00c9041afa2c4ecd96785c104bd2199267ae2c1983f618f84

Ihor_Haranichev
Participant
0 Likes

4ab5faabb6ff6419635c7df5bf5465e7c8533258da0dcac2cb99678fb97583d7

Guru_Charan
Explorer
0 Likes

6ed1f728f24f922c053771f7e1b4c0829540f65de311dfe9276875545f498026

_Jakub_
Explorer
0 Likes

7159b5aabe28ce3c563b8a4eafb125cc5ae62fa471809d7519e869947a728c9f

shubhamkar
Explorer
0 Likes

762fbd9d48f8862c0a2b891d563d7e8b44b5eda0f4ec56d3f4dd8882830088b3