on ‎2023 Aug 04 1:23 PM
I have an action button in behaviour definition I have defined the below
This below example doesn't have any Ui5 coding
storePut is function import
action ( features: instance) storePut parameter D_StorePutAbsEn result [1] $self
D_StorePutAbsEn is an abstract entity cds which opens the dialog having all fields like
Key F1
F2
I want to default a value to a drop-down for field F1.
Is there any annotation in cds or annotation in xml by which a value can be default to a drop-down inside the dialog.??
Any example how to achieve it .?
Request clarification before answering.
Hi Abhishek,
See below documentation .
Prefilling Fields Using the DefaultValuesFunction
<FunctionImport Name="GetDefaultsForSetText" ReturnType="cds_zrc_dv_defaultvalues.ZRC_DV_A_SetText" m:HttpMethod="GET" sap:action-for="cds_zrc_dv_defaultvalues.RootType">
<Parameter Name="UUID" Type="Edm.Guid" Mode="In"/>
</FunctionImport>
<Annotations xmlns=http://docs.oasis-open.org/odata/ns/edm Target="cds_zrc_dv_defaultvalues.cds_zrc_dv_defaultvalues_Entities/SetText">
<Annotation Term="com.sap.vocabularies.Common.v1.SideEffects" Qualifier="Action">
<Record>
<PropertyValue Property="TargetProperties">
<Collection>
<PropertyPath>Text</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="com.sap.vocabularies.Common.v1.DefaultValuesFunction" String="GetDefaultsForSetText"/>
</Annotations>
Best wishes,
Ramjee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramjee,
I can then use this annotation in my XML .
I already having the function import name..
I had one doubt suppose I am just using this annotation <Annotation Term="com.sap.vocabularies.Common.v1.DefaultValuesFunction" String="GetDefaultsForSetText"/>
</Annotations>This method implementation logic needs to be added in backend to default values.
Or in annotation.xml do we have to provide the fields and default values.
"GetDefaultsForSetText" here this being the function import name. The default method has to be created in rap .??
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.