cancel
Showing results for 
Search instead for 
Did you mean: 

Preview and Edit not working for adaptation project for Transactional Application

bwal
Discoverer
0 Kudos
277

Hello,

I would like to add a custom action similar to this example to the application Manage Sales Orders v2. Is this feasible?

This is what I've tried so far:

I have created an adaptation project in Visual Studio through the generator. Now when I try to preview or edit it (both through the graphic interface and through npm run start and npm run start-editor) the launchpad opens with the error "App could not be opened because the SAP UI5 component of the application could not be loaded. Failed to load UI5 component for navigation intent "#app-preview" ".

This is from the network tab of the devtools:  

Title: ErrorMessage: App could not be opened because the SAP UI5 component of the application could not be loaded.Details: { "info": "Failed to load UI5 component for navigation intent \"#app-preview\"", "technicalMessage": "failed to load 'sap/cus/sd/lib/slsdoc/manage/library.js' from ../resources/sap/cus/sd/lib/slsdoc/manage/library.js: script load error\nModuleError: failed to load 'sap/cus/sd/lib/slsdoc/manage/library.js' from ../resources/sap/cus/sd/lib/slsdoc/manage/library.js: script load error\n at we (http://localhost:8080/resources/sap-ui-core.js:10:6645)\n at ge.failWith (http://localhost:8080/resources/sap-ui-core.js:10:4709)\n at HTMLScriptElement.i (http://localhost:8080/resources/sap-ui-core.js:10:10498)\nCaused by: Error: script load error\n at HTMLScriptElement.i (http://localhost:8080/resources/sap-ui-core.js:10:10540)"}

There are no errors in the console in vscode

I have tried change #app-preview to #SalesOrder-manageV2 in the package.json file but I got the same error with #SalesOrder-manageV2

 

Does anyone have any ideas what could I try?

Thanks,

Ben

View Entire Topic
junwu
Active Contributor
0 Kudos

I quickly tested in my environment. it works.

for your error, what node js version you are using? i am using node js v20

 

onAfterRendering: function () {

var page = this.getView().byId("cus.sd.salesorderv2.manage::SalesOrderManageObjectPage--fe::ObjectPage");

var mybtn = new sap.m.Button(this.getView().createId("mybtn"), { text: "mybtn" });
var headerTitle = page.getAggregation("headerTitle");
headerTitle.addAction(mybtn);

},

 

junwu_0-1723566090022.png