Delete Record from a Entity wrt to a record field in another Entity

I have a scenario where i have to delete record for a tracking id wrt field in another entity.
How could i achieve this

@Satish_Ch - Can you please clarify a little bit more about this “delete record for a tracking id wrt field in another entity”. Maybe a screenshot of what you are doing.

From the error it seems like you trying to delete multiple records using the batch activity. If that is the case, you need to provide List of all the Ids that you want to delete as input to the activity.

@Satish_Ch - Thanks for the clarification.

Is the variable IPNRequestTrackIdList a list of Tracks or Track Details?

If it is a list of Track Details, you should use item.Id to delete those records.

If it is a list of Tracks, you will first have to get all the Track Details using the query activity that have a particular Track as parent and then delete it.

  • Use the query activity on NPSIPNRequestTrackDetails entity and set the query rule as IPNRequestTrackId = item.Id, lets store it as itemTrackDetails variable.
  • Then setup a ForEach loop on itemTrackDetails variable and let’s call each item as trackDetails.
  • Then your delete activity should have trackDetails.Id as the input in the new ForEach loop.

You can optimize the performance by using the new ForEach loop to create a List of trackDetails.Id and then pass it in a single call to “Delete Multiple Entity Records” activity. Please look at Uploading data from CSV using batch activities to see a sample of batch activity usage for Create activity but Delete will be similar experience.

2 Likes

You can only delete the records for which you have the Ids.

If you have the Track records, you need to first get the Track Details to delete them.

If you have Track Details, you can delete them already.

Do we have any sample sequence anywhere for this?

@Satish_Ch - Here is a sample showing both the individual delete and the batch delete.
Delete Sample.zip (17.9 KB)

The two entities are Order & OrderLineItem with the following schema -


1 Like

Hi @ankit.saraf ,

Your Response is Valuable but i have one question -
How to delete the records if suppose three Enity are connected to each other?

Thanks
Rounak