cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to bind SectionContactCellTable with a service having both filter and expand options

aanchal_kajaria
Participant
0 Kudos

Hello,

I have an issue to use a service like sap/opu/odata/SAP/ZME_PM_CREATE_NOTIFICATION_SRV/FuncLocExistSet?$filter=FuncLoc eq 'TL2-211'&$expand=FLocToFLocListUSNav in my MDK app.

Trying to bind my table like below:


The QueryOptions are set like below for my service:

But this does not seen to work and I see no data in the SectionedTable. Attached is the metadata of the service.metadatazme-pm-create-notification-srv.txt

Pls help.

Best regards

Aanchal

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Aanchal,

In this case, your relationship between FuncLocExistSet and the navigation property FLocToFLocListUSNav is a 1 to Many relationship. This means that for every FuncLocExistSet item you can have 0, 1 or more FLocToFLocListUSNav items. As a result you can't directly reference a property in the FLocToFLocListUSNav entity. You could reference an indexed item from the result set but using a target path based on the index.

{FLocToFLocListUSNav/0/FuncLocText}

This will return the FuncLocText for the first item in the FLocToFLocListUSNav navigation property set.

--Bill

aanchal_kajaria
Participant
0 Kudos

Hello Bill,

Thanks for your response.

I got some changes done in the service and now with the changed service, still not able to bind the Functional Locations like below in my page FunctionalLocs_List.page:

{ "Caption": "FunctionalLocs_List", "Controls": [ { "Sections": [ { "EmptySection": { "FooterVisible": false }, "ObjectCell": { "AccessoryType": "none", "Description": "{FuncLocText}", "DetailImage": "res://mdk_logo.png", "DetailImageIsCircular": false, "PreserveIconStackSpacing": true, "ProgressIndicator": "inProgress", "Title": "{FuncLoc}" }, "Target": { "EntitySet": "FLocListfromSettingSet", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service" }, "Visible": true, "_Name": "SectionObjectTable0", "_Type": "Section.Type.ObjectTable" } ], "_Name": "SectionedTable0", "_Type": "Control.Type.SectionedTable" } ], "_Name": "FunctionalLocs_List", "_Type": "Page" }

Attached is the new metadata of the service.

metadatazme-pm-create-notification-srvnew.txt

Please help here.

Thanks and regards

Aanchal

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Aanchal,

First, have you verified that your FLocListfromSettingSet is returning data as expected? This can be done by getting the Destination URL from Mobile Services and accessing with a browser to verify that the set is returning data as expected.

Second, are you seeing any errors displayed? are you just getting a blank page?

Try adding Empty Section Caption to see if that displays for the test page.

--Bill

aanchal_kajaria
Participant
0 Kudos

Hello Bill,

I check for the service /sap/opu/odata/SAP/ZME_PM_CREATE_NOTIFICATION_SRV/FLocListfromSettingSet?$format=json, returning me 18 values in the Gateway client(GWClientServiceRun.png)

Also, if I bind to another entity PrioritiesListSet, I am able to see values in the FunctionalLocs_List.page (PrioritiesListBinding.png). Also, could see text put in Empty Section Caption when navigating to this page and binding with FLocListfromSettingSet. Don't see any error just a blank page when binding to this entity(unable to attach image)

The destination in the Mobile services cockpit is also pinging successfully(unable to attach image).

I am really not sure what is missing now!

Thanks and regards

Aanchal

gwclientservicerun.png

prioritieslistbinding.png

aanchal_kajaria
Participant
0 Kudos

The other 2 screenshots, mentioned in the reply above:

emptycaptioncheck.png

mobservicesdestpingsuccess.png

Pls help to check this as this is urgent for me now!

Best regards

Aanchal

bill_froelich
Product and Topic Expert
Product and Topic Expert

From the Mobile Services cockpit have you tried the Odata destination test (icon the to left to ping). Click that and then click Next. You should see a drop down with the list of entity sets. Select the FlocListfromSettingSet and verify you see the same 18 rows.

Also, is this an offline or online application?

If offline, please also verify your initializeofflineodata is downloading the FlocListFromSettingSet. Otherwise you will see the behavior you describe where there is no data since it hasn't been downloaded into the offline store.

--Bill

aanchal_kajaria
Participant
0 Kudos

Hi Bill,

I tried to check Odata destination in the Mobile Services cockpit, but don't see all 18, but only 5 rows for the entity, FlocListfromSettingSet. There is a message that says only top 5 are shown.

odatadestcheckforentity.png

Pls tell me how I can verify Initializeofflineodata is downloading the FlocListFromSettingSet? Metadata for InitializeOffline.action is like below:

{ "ActionResult": { "_Name": "init" }, "ActivityIndicatorText": "Downloading...", "DefiningRequests": [ { "Name": "PMNotificationSet", "Query": "PMNotificationSet" }, { "Name": "FLocListfromSettingSet", "Query": "FLocListfromFLocListfromSettingSet" }, { "Name": "EquiListfromFLocSet", "Query": "EquiListfromFLocSet" }, { "Name": "NotifTypeListSet", "Query": "NotifTypeListSet" }, { "Name": "PrioritiesListSet", "Query": "PrioritiesListSet" }, { "Name": "FuncLocExistSet", "Query": "FuncLocExistSet" } ], "OnFailure": "/ZME_CREATENOTIFICATION/Actions/Service/InitializeOfflineFailureMessage.action", "OnSuccess": "/ZME_CREATENOTIFICATION/Actions/Service/InitializeOfflineSuccessMessage.action", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service", "ShowActivityIndicator": true, "_Type": "Action.Type.OfflineOData.Initialize" }

Thanks

Aanchal

aanchal_kajaria
Participant
0 Kudos

I changed the metadata of IntializeOffline.action now to:

{ "ActionResult": { "_Name": "init" }, "ActivityIndicatorText": "Downloading...", "DefiningRequests": [ { "Name": "PMNotificationSet", "Query": "PMNotificationSet" }, { "Name": "FLocListfromSettingSet", "Query": "FLocListfromSettingSet" }, { "Name": "EquiListfromFLocSet", "Query": "EquiListfromFLocSet" }, { "Name": "NotifTypeListSet", "Query": "NotifTypeListSet" }, { "Name": "PrioritiesListSet", "Query": "PrioritiesListSet" }, { "Name": "FuncLocExistSet", "Query": "FuncLocExistSet" } ], "OnFailure": "/ZME_CREATENOTIFICATION/Actions/Service/InitializeOfflineFailureMessage.action", "OnSuccess": "/ZME_CREATENOTIFICATION/Actions/Service/InitializeOfflineSuccessMessage.action", "Service": "/ZME_CREATENOTIFICATION/Services/ZME_PM_CREATE_NOTIFICATION_SRV.service", "ShowActivityIndicator": true, "_Type": "Action.Type.OfflineOData.Initialize" }

Somehow it appeared wrong for this entity before- { "Name": "FLocListfromSettingSet", "Query": "FLocListfromFLocListfromSettingSet" }

But still I m not able to bind my Entity.

Thanks

Aanchal

aanchal_kajaria
Participant
0 Kudos

Hi Bill,

I was able to achieve the binding with entity FLocListfromSettingSet when created a test app with only online features. Did not select Offline option and checkmark for entities in below screen:

But, then as my app is meant for offline usage, can you tell me what change I need to do now? Also, is there a limit or a recommendation for how much data should be allowed to be downloaded for offline usage? We are trying to limit the data by allowing users to choose some functional locations as settings and then seeing the further 2 level down hierarchical functional locations only in the list, other wise a lot of data can be sent by the service call, which the app may not be able to handle. Any recommendations to handle such a case?

Thanks and regards

Aanchal

bill_froelich
Product and Topic Expert
Product and Topic Expert

As you found, the initialization for offline odata did not have the correct entity name. You should also check your download action to verify it is correct there as well.

Since you have already initialized the offline db, the easiest thing would be to logout and re-onboard again. This will reinitialize the offline db with the correct data and should fix the problem with your list.

Give that a shot and let us know how it goes.

aanchal_kajaria
Participant
0 Kudos

Thanks Bill! Onboarding again helped and I am able to use the entity now. I was really not clear on how these actions and offline db stuff works. Understand better now. I need to focus on how data is handled.

Answers (0)