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

MDK Web + mobile app

Facundo_Quevedo
Explorer
0 Likes
1,651

Hi experts, I am trying to make my MDK application work for the web, but the problem I am running into is that the master data isn't loading. I have already configured the BTP destination and also pointed the mobile services destination to the BTP destination. I don't know if I am missing a step in the configuration. For more context, the MDK app has offline capabilities.

Accepted Solutions (1)

Accepted Solutions (1)

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Likes

The InitializeOffline.action defined in your MDK project is of type Action.Type.OfflineOData.Initialize which is applicable to mobile only. This action type won't work (and is not supported) on MDK web, which is why your MDK web doesn't initialize the service.

As we expanded MDK support for web some time ago, we introduced a new action type Action.Type.ODataService.Initialize that will work for both mobile (online/offline) and web (online only) platforms in a given MK project. This way, you can run the same MDK metadata on both mobile and web platforms(keeping web runtime limitations in mind). 

You can:

  • either update the _Type in your existing InitializeOffline.action (Change OfflineOData to ODataService).
  • OR use a platform function to call different actions on different platforms using $PLT(ios, android, web). 

For example:

 

 

"OnLaunch": ["$(PLT,/MDKApp/Actions/Service/InitializeOffline.action,/MDKApp/Actions/Service/InitializeOffline.action,/MDKApp/Actions/Service/InitializeOnlineWeb.action)"],

 

 

Hope this helps.

Facundo_Quevedo
Explorer
0 Likes

Hi jitendra thank you it work 

Answers (1)

Answers (1)

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Likes

@Facundo_Quevedo 

Could you share how the OData service is initialized in your application?  Open the action bound to OnLaunch event under Application.app.

Facundo_Quevedo
Explorer
0 Likes

This is how it's initialized. I also created an action for online use, but I don't know how I'm supposed to add it.

Facundo_Quevedo_0-1716833348521.pngFacundo_Quevedo_1-1716833376374.png

Facundo_Quevedo_2-1716833406329.png

 

 

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Likes
@Facundo_Quevedo could you share the Action Type for InitializeOffline.action?
Facundo_Quevedo
Explorer
0 Likes

Facundo_Quevedo_0-1716834176502.png

 

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Likes
I am actually looking for _Type. Could you open the action in text editor and share the _Type for the InitializeOffline.action?
Facundo_Quevedo
Explorer
0 Likes

Okay, here is the type. Don't pay attention to the service error, I just deleted it.

Facundo_Quevedo_0-1716834881448.png

 

 

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Likes

You shared the screenshot from InitializeAppWeb.action. I wanted to look at the definitition from InitializeOffline.action https://community.sap.com/t5/image/serverpage/image-id/116094i5A3DAACCAE1A53D4

Edited: Looks like you updated your last comment with screenshot (what I asked in this comment). All good. I got what I was looking.