cancel
Showing results for 
Search instead for 
Did you mean: 

Delete/Remove email address in PerEmail entity with sapsf odata

former_member596608
Discoverer
0 Kudos

When using the sapsf odata API I can update and replace existing email address on the PerEmail entity with upsert and purgeType=full. I can also remove one of two address.
But I can't find any documentation of how to remove ALL (or the last one) email addresses for a person. I've tried with the delete command and also tried with upsert and purge and setting the email address to null, but nothing works.
So... How do I make a REST odata call to actually remove all email addresses for a person?

ibhavaraju
Discoverer
0 Kudos

I need to update or replace an existing email as a primary email using PerEmail. But I am not able to find how to do this.

Accepted Solutions (0)

Answers (2)

Answers (2)

gerald_reinhard
Product and Topic Expert
Product and Topic Expert

Hi,

the only released way of deleting emails is the "operation" field in the upsert operation of OData (all other approaches are either deprecated (SOAP) or for internal use only (CompoundDelete in OData)) This is a payload to delete the last email record of employee 103223 with EmailType 8448

POST <your API URL>/odata/v2/upsert

Authorization : Basic <your base64 encode of "Basic: apiuser@company:password">

Content-Type : application/json

{ "__metadata": { "uri": "https://apisalesdemo4.successfactors.com:443/odata/v2/PerEmail(emailType='8448',personIdExternal='103223')", "type": "SFOData.PerEmail" }, "emailType": "8448", "personIdExternal": "103223", "operation": "DELIMIT" }

See also Import Help for supported further entities.

Best regards

Gerald

former_member760
Explorer

Thanks, the fact that this also works for the API and not only for files is not clearly documented in SAP's documentation. That this works using the API instead only with file import is a life saver. Just wondering what other "hidden gems" exist in the API.

Thanks,

Marc

siddharthrajora
Product and Topic Expert
Product and Topic Expert

Only these activities are supported as you listed, i didnt see DELETE.

You can always check in Data dictionary or in the ODATA API reference library.

Full Purge - Existing record is deleted when the upsert operation is performed. A new record is created with the data specified through a URL parameter.


Incremental Purge - Only records specified in the payload is purged and replaced. All other records remain untouched. The data is specified through a URL parameter.

Here's the KBA Reference:

2670250 - OData Operations and Purge Types For Inbound Integrations

https://launchpad.support.sap.com/#/notes/2670250

However you can use this

https://launchpad.support.sap.com/#/notes/2375294

2375294 - How to use the Compound Delete for Employee Central (Mass Delete Grid Portlet Data)

former_member596608
Discoverer
0 Kudos
I've tried the incremental purge scenario. But when I try to replace the email with "nothing" it refuses to accept it. See attached document.

set-email-address-to-null.jpg