cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create button not visible

martag1
Explorer
0 Likes
5,961

I'm trying to add fiori annotations so I can add new countries codes to Countries entity ( from'@sap/cds/common) .

Problem is that in Fiori preview I cannot see create button :

using CatalogService from './cat-service.cds';

annotate CatalogService.Countries with @( Capabilities.InsertRestrictions.Insertable : true, // Object Page Section UI.LineItem : [ { $Type : 'UI.DataField', Label : '{bi18n>objectType}', Value : code, ![@UI.Importance] : #High }, { $Type : 'UI.DataField', Label : '{bi18n>accessoryId}', Value : name, ![@UI.Importance] : #High }
]);What can I do to enable create button?

Accepted Solutions (0)

Answers (2)

Answers (2)

msiblyb
Explorer
0 Likes
Insert the following code in your schema.cds file

@odata.draft.enabled
@odata.draft.bypass
entity entityname {
fields...
...
}


Deploy your code...
Run...
 
MioYasutake
SAP Champion
SAP Champion
0 Likes

Hi martag1,

The following thread may help. With OData V4, create button becomes visible only if you enable draft.

https://answers.sap.com/questions/13503510/cap-nodejs-create-button-missing-in-odata-preview.html

martag1
Explorer
0 Likes

Hi mioyasutake

What should I do if I don't need draft functionality ?

Is single key in my entity required when I enable draft?