function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Daniel GudzikDaniel Gudzik 

Get groupId and memberId when using /sobjects/groupmember/deleted API

Hi,

Is it possible to get groupId and memberId when getting a groupMemberId from /sobjects/groupmember/deleted API ?

I am using this API to get notified regarding deleted group members.
The response is just groupMemberId, but since it was already deleted, its not in the groupMember table anymore.
How can I get the information about this ID (groupID, memberID) ?

Thanks in advance!
Sampath SuranjiSampath Suranji
Hi,
You can use the ALL ROWS keywords to query all records in an organization, including deleted records and archived activities.
Check This (https://developer.salesforce.com/forums/?id=906F0000000g33RIAQ)
regards
Daniel GudzikDaniel Gudzik
Hi,

Thanks for your response!
Unfortunatly it doesn't work.

I deleted a group member and executed the following query in postman:
...salesforce.com/services/data/v45.0/sobjects/groupmember/deleted?start=2019-03-04T18%3A40%3A00Z&end=2019-03-25T13%3A00%3A50Z

Response:
{
    "deletedRecords": [
        {
            "deletedDate": "2019-03-25T10:18:34.000+0000",
            "id": "0111t0000005jvMAAQ"
        }
    ],
    "earliestDateAvailable": "2018-12-16T17:17:00.000+0000",
    "latestDateCovered": "2019-03-25T02:16:00.000+0000"
}

Then I queried for this group member with ALL ROWS:
 
...salesforce.com/services/data/v45.0/query?q=SELECT Id,groupId,userOrGroupId FROM groupMember where id='0111t0000005jvMAAQ' ALL ROWS

But the response is as follows:
[
    {
        "message": "ALL ROWS not allowed in this context",
        "errorCode": "MALFORMED_QUERY"
    }
]

What wrong have I done?
Any suggestions to get the group ID and member ID of the deleted record using API (in postman, not in Java code)

Thanks in advance!
Sampath SuranjiSampath Suranji
Hi,
Sorry for the delay,
I think we cannot use ALL ROWS keyword inside  Developer console, data loader, postman etc.. It is supported only inside the Apex SOQL code