4

Good morning,

I've been trying to delete PushNotification setup for a CustomApplication with the Metadata API (version 46.0 ) but although the answer is successful the changes are not done in my developer organization.

Manual access to push notification:

Salesforce Classic >> Setup >> Create >> Apps >> "My app" >> Choose Push Notifications >> Select objects and fields for notifications

Use case

  1. Deploy a CustomApplication with some PushNotification setup. Example of CustomApplication Metadata xml:
[...]
<consoleConfig>
[...]
    <pushNotifications>
        <fieldNames>Account</fieldNames>
        <objectName>Case</objectName>
    </pushNotifications>
[...]
</consoleConfig>
[...]
  1. Deploy the same CustomApplication removing all PushNotifications. Example of CustomApplication Metadata xml:
[...]
<consoleConfig>
[...]
    <!-- All tags of pushNotifications had been removed -->
[...]
</consoleConfig>
[...]

Expected

All the push notifications are removed from the developer organization

enter image description here

Actual

All the push notifications are NOT removed from the developer organization

Push notifications

Question

  • Is it possible to complete remove all PushNotification from CustomApplication using Salesforce Metadata API?
  • If it is possible, please could you let me know how?
  • The problem is that SF counts null list in update metadata xml as that you do not want to do anything with this component. However, it's completely different with existing, but empty list, than it withdraw all notifications. I just don't know how to set up empty, not null, list in xml format. – Mariia Illarionova Oct 24 '19 at 7:40
0

I replicated the same issue in API 47.0 in various ways:

  1. Removing all the push notifications tags as you did
  2. Trying to keep the tags but leaving blanks as values for the different tags (<objectName> </objectName>, <pushNotifications> </pushNotifications>)

  3. Specifying null in the tags

  4. Trying to make the different tags empty (<pushNotifications />, <objectName />, <fieldNames />)

I either get an error that Required field is missing: fieldNames or Invalid Push Notifications: .

The only thing that works is to deploy new push notifications and remove the old ones at the same time.

However, that doesn't really solve the issue at hand if you want to remove all at once. I'd suggest a Salesforce case to confirm, but I'd take an educated guess that you cannot remove push notifications completely from a custom app through the metadata API.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.