So I'm working on this app. After finishing up 2 days ago, I intended to continue working on it yesterday. But... the editor suddenly handed me all kinds of error messages. Like "Incompatible type. We can't evaluate your formula because the values being compared in the formula aren't the same type."
Even stranger:
- when I left it, everything was working. Nobody worked on it in the meantime.
- if I 'F5/preview' the app in the browser from the editor screen, the parts that indicate errors don't work
- but I published the app and 'play'ed it in the browser, and everything works correctly (including the parts that rely on formulas that now give editor errors)
But just as sudden as it appeared, at the end of the day the problem seemed to have resolved itself. Which would be a good thing, except... the problem returned just now, so I can still not continue working on the app.
My suspicion is that somehow the editor is starting to get confused about the type of items stored in a local collection compared to a remote datasource.
To indicate the outline of my app architecture: I'm creating a few local collections of entities that the user has to work on (this is because the app has a partial offline requirement). So I'm doing things like:
(OnSelect of a button after user makes a selection):
// Gather required data locally
// 'currentElements' will be a collection of items that were loaded from the CDS data source entity 'Elements'Collect( currentElements, Filter( [@Elements], <filter> );
(Later in the app, I display these items in a gallery with a filter)
[Gallery.Items =] Filter( currentElements, FilterField='FilterField( Elements )'.Yes )
(In another place, when attempting to save)
If( Connection.Connected,
Patch( Elements, elem, { Action: 1 } );
,
Collect( savebuffer, elem );
);
The highlighted parts are now problematic according to the editor. The first one says 'incompatible type' and the second one 'Expecting a OptionSetValue value, but of a different schema.'
I'm at a loss how to solve it. I already tried:
- Clearing browser cache, restarting the browser
- Restore a previous save
- Re-adding a data source that throws errors
Ideas? Could this be a bug?