In an application, I had created two receive locations one FILE based and the other FTP based.
The FILE based location was to be removed (as it was not required now), so it was to be deleted and while deleting it, got below error:
Why it happened:
The FILE based receive location was created first and then FTP based receive location. So whenever you have a Receive port having more than one receive location then the receive location which was created first is automatically marked as the primary location. If there is only one then that is the primary location.
As can be seen above, FILE based receive location has been marked as Make this the primary location and checkbox is disabled for change.
What to do:
There are two ways to delete primary location
1. Delete the Receive port, create new with only FTP based receive location (so this will be the primary location) ---> This is ok in this scenario where I have only two receive location but if there are more then not at all good solution.
2. Mark the other Receive location as Make this the primary location, doing this will make the earlier receive location as not primary - which makes it available for deletion
So I went ahead with second way and mark the FTP based receive location as primary location
After doing this the FILE based receive location got it's Make this the primary location unchecked and become available for deletion. And I was able to delete it.