cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

I get the error Path title leads to element. The path should lead to type Edm.PrimitiveType.CDS (annotations) . It happens 9 times for every $Type : and value pair.

The strange thing is even with the error I still see Fiori preview rendering Risks correctly. However, Mitigations and BusinessPartners do not show anything on Fiori preview.

The following is my annotations.cds which is copied from the course content.

// using RiskService as service from '../../srv/risk-service';using RiskService from '../../srv/risk-service'; // Risk List Report Page annotate RiskService.Risks with @(UI : { HeaderInfo : { TypeName : 'Risk', TypeNamePlural : 'Risks', Title : { $Type : 'UI.DataField', Value : title, }, Description : { $Type : 'UI.DataField', Value : descr, } }, SelectionFields : [prio], Identification : [{Value : title}], // Define the table columns LineItem : [ {Value : title}, {Value : miti_ID}, {Value : owner}, {Value : bp_BusinessPartner}, { Value : prio, Criticality : criticality }, { Value : impact, Criticality : criticality }, ], }); // Risk Object Page annotate RiskService.Risks with @(UI : { Facets : [{ $Type : 'UI.ReferenceFacet', Label : 'Main', Target : '@UI.FieldGroup#Main', }], FieldGroup #Main : {Data : [ {Value : miti_ID}, {Value : owner}, {Value : bp_BusinessPartner}, { Value : prio, Criticality : criticality }, { Value : impact, Criticality : criticality } ]}, });
View Entire Topic
michaelschmid03
Explorer

In my Company, we have had this exact Issue. This is how you can fix it
1. Update the following package: npm install @sap/ux-cds-odata-language-server-extension
2. Delete the "SAP CDS Language Support" extension.
3. Close VS Code
4. in the Folder "C:\User\<User>\.vscode\extensions" delete the subfolder "sapse.vscode-cds-<version>"
5. Start VS Code and Install the Extension again.

This has resolved the issue for me and my colleagues.

Ask a Question