cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway Service annotations - valuelist default value

michael_smithe5
Participant
0 Kudos

I have a datafield Country on a custom entity Customer. I have added the valuelist annotation to that field and made it fixed-values which all appears to work. However, when I create a new customer, I want the country to default to 'US'. Is there a way to set the default value in the DEFINE method of the MPC_EXT class or do I have to extend the Object Page of my List Report Fiori Elements application to set the default country?

View Entire Topic
junwu
Active Contributor
0 Kudos

what is your architecture?

i tried with cds+bopf, you just have to add a determination to set the default value, it can be easily done.

if you use odatamodel createentry, you can set the default value in the parameter, I didn't try.

michael_smithe5
Participant
0 Kudos

We are on a HANA 2.0 system, but we chose to use strictly Gateway Services without CDS (although I think we will eventually move to using CDS). Sadly, I could not find a way to accomplish pre-populating default values with the generated object page, so I chose to create my own UI5 application from scratch using a smart table and a smart form where I can do the necessary coding in the controller.