I have recently started developing with Fiori Elements and testing our the capabilities on a test project. The project is based on cap and has a cds view where we have defined some custom key like:
entity Subaccounts : managed {
key subaccountId: String(100);
key applicationId: String(100);
globalAccountId: String(100);
associatedGlobalAccount: Association to GlobalAccounts on globalAccountId = globalAccountId.globalAccountId;
...
}
entity GlobalAccounts: managed {
key globalAccountId: String(100);
name: String(500);
...
}
The app should represent the BTP cockpit with its applications, therefore I need a lot of Association between the entities. The app itself should have a basic Fiori elements frontend where you can click on "edit" in the Global accounts view for example and then edit the global account or create a new subaccount. The problem we are currently facing is that we get the following error:
SQLITE_CONSTRAINT: NOT NULL constraint failed:
When clicking on "Edit" we do not get a popup like when clicking on "Edit" in the list view. Therefore, I assume that this error is related to the fact that we do not pass the key for the Subaccount in the creation. Thus I wanted to know if there is a way to assign the new subaccount a key during the creation process which should be the global account Id where I am currently in?
What we also have tried is to not set the subaccountId as key and subelement the Subaccounts entity with CUID. When doing so, we do not get this issue but we also cannot set the globalAccountId of the subaccount entity as the globalAccounts one, where we are currently in.
In my internet search I have not found something similar, therefore I am not sure if this is possible or if we have to switch to Fiori freestyle instead.
Thank you very much in advance!