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

SAP CAP virtual field leads to out of memory

T1mey
Active Participant
1,395

Hello @all,

we have some trouble with virtual fileds in CAP 7.2.1

virtual isAdmin           : Boolean default false;
virtual appTypeIcon       : String default 'img/phenix_blue.svg';

We're controlling some input fields and switching an icon depending on the type.

It seems that we're ending up in an infinite loop when accessing the object page for some reason.

The Fiori elements UI freezes and ends up in an out of memory exception.

CAP log shows this

AFTER READ DRAFT !!!
[odata] - POST /odata/v4/application/$batch
[odata] - > READ Applications(ID=09ed2125-03a0-401c-affe-203670e7a83c,IsActiveEntity=false) { '$select': 'appTypeIcon' }
AFTER READ DRAFT !!!
[odata] - POST /odata/v4/application/$batch
[odata] - > READ Applications(ID=09ed2125-03a0-401c-affe-203670e7a83c,IsActiveEntity=false) { '$select': 'appTypeIcon' }
AFTER READ DRAFT !!!
[odata] - POST /odata/v4/application/$batch
[odata] - > READ Applications(ID=09ed2125-03a0-401c-affe-203670e7a83c,IsActiveEntity=false) { '$select': 'appTypeIcon' }
AFTER READ DRAFT !!!
[odata] - POST /odata/v4/application/$batch
[odata] - > READ Applications(ID=09ed2125-03a0-401c-affe-203670e7a83c,IsActiveEntity=false) { '$select': 'appTypeIcon' }
AFTER READ DRAFT !!!
[odata] - POST /odata/v4/application/$batch
[odata] - > READ Applications(ID=09ed2125-03a0-401c-affe-203670e7a83c,IsActiveEntity=false) { '$select': 'appTypeIcon' }

In previous versions used our coding worked. Seems to be some problem with 7.2.x maybe.

Or it might be related to the new sqlite package, as we switched to that as well.

Anybody similar problems ?

Accepted Solutions (0)

Answers (2)

Answers (2)

T1mey
Active Participant

Please make sure to set the virtual field(s) in your event handler in every case (not only conditiuonal) to a value.

Cmdd
Participant
0 Likes

Thanks! I (apparently) solved all my problems by setting default values to virtual fields both in "regular" and in draft mode

T1mey
Active Participant
0 Likes
enjoy... took me some time to understand it
T1mey
Active Participant
0 Likes

It seems to be related to the new @cap-js/sqlite package.

TatianaFetecua
Explorer
0 Likes

Hi Tim, Were you able yo solve it? if yes could you please provide a solution I think that I have the same problem with a virtual field.

Thanks in advance.

Tatiana F.

T1mey
Active Participant
0 Likes

In my case I assume that it has something to do with a virtual field, because if I remove that the memory problem does not occour anymore.

0 Likes
Hello, even I'm facing the same issue with virtual field. Did you get any solution?