cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK 23 UpdateEntity Error "A query for link targets returned zero targets"

cabraldaniel
Explorer
0 Kudos
326

Hi All!

We're migrating our MDK app from version 6.3.2 to 2310 and one of the issues we're facing is an error when triggering an UpdateEntity Action, which show us the following error:

 

mdk.trace.action: Error running action propagating error Action.Type.ODataService.UpdateEntity.1: Error: A query for link targets returned zero targets : Error: A query for link targets returned zero targets
    at ODataLinkUpdater.acquireTargets (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145676:19)
    at ODataLinkUpdater.execute (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145655:14)
    at ODataLinkUpdater.execute (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145537:19)
    at ODataUpdater.executeLinkUpdaters (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145302:33)
    at ODataUpdater.executeLinkers (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145287:14)
    at file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145261:18
    at new Promise (<anonymous>)
    at ODataUpdater.execute (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:145257:16)
    at ODataServiceProvider.updateEntity (file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:142259:33)
    at file:///data/data/com.vale.ptsdigitalqas/files/app/vendor.js:141341:34

 

 While debugging the app I tried to find some rule script which could be failing but this comes directly from the oData Update process.

The action is:

{
	"_Type": "Action.Type.ODataService.UpdateEntity",
	"ActionResult": {
		"_Name": "update"
	},
	"OnSuccess": "/PTSDigital/Actions/Logs/ExpiredAfterTwentyFourHours.action",
	"ShowActivityIndicator": true,
	"ActivityIndicatorText": "$(L,'saving')",
	"Target": {
		"Service": "/PTSDigital/Services/ptsdig.service",
		"EntitySet": "SafeWorkPermissions",
		"QueryOptions": "/PTSDigital/Rules/ClientData/ReturnSwpIdFromClientData.js"
	},
	"Properties": {
		"status_id": "EXPIRED",
		"status_language": "PT"
	},
	"UpdateLinks": [
		{
			"Property": "status",
			"Target": {
				"EntitySet": "Status",
				"QueryOptions": "$filter=id eq 'EXPIRED' and language eq 'PT'"
			},
			"_Enabled": true
		}
	]
}

 ...and I'm sure the rule in QueryOptions returned the expected value.

What I'm missing here?

Thanks in advance!

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

From the error, I am guessing that the query on the status entity filtering for id eq 'EXPIRED' and language eq 'PT' is not returning any results.  I would double check that first to ensure it is returning the expected data.

cabraldaniel
Explorer
0 Kudos
Bill, you were right, thank you! For some reason this filter wasn't working at all on MDK 6.3.2. After the update to 2310 looks like it began to work. We removed it to make the action works as expected. Thank you!