1

I have created an Email Service Function which looks something like below:

<?xml version="1.0" encoding="UTF-8"?>
<EmailServicesFunction xmlns="http://soap.sforce.com/2006/04/metadata">
    <apexClass>XXXEmailHandler</apexClass>
    <attachmentOption>None</attachmentOption>
    <authenticationFailureAction>Discard</authenticationFailureAction>
    <authorizationFailureAction>Discard</authorizationFailureAction>
    <emailServicesAddresses>
        <authorizedSenders>google.com</authorizedSenders>
        <developerName>XXX</developerName>
        <isActive>true</isActive>
        <localPart>xxxemailservice</localPart>
        <runAsUser>[email protected]</runAsUser>
    </emailServicesAddresses>
    <functionInactiveAction>Discard</functionInactiveAction>
    <functionName>XXXEmailService</functionName>
    <isActive>true</isActive>
    <isAuthenticationRequired>false</isAuthenticationRequired>
    <isErrorRoutingEnabled>false</isErrorRoutingEnabled>
    <isTextAttachmentsAsBinary>false</isTextAttachmentsAsBinary>
    <isTlsRequired>false</isTlsRequired>
    <overLimitAction>Discard</overLimitAction>
</EmailServicesFunction>

As you see, there is a username provided for the value runAsUser. Now when I try to deploy this metadata in another org, it gives an error below:

In field: Username - no User named [email protected] found

How can I deploy this metadata file, or what should I change in this file so that this can be deployed in any instance?

1
  • Error message clearly says there is no user name with '[email protected]' in destination org. Kindly re-check if you have this user or update with the existing user name that exists in destination org and you should be able to deploy.
    – Vinay
    Commented Oct 9, 2020 at 22:43

1 Answer 1

0

Try to remove runAsUser property from the file and deploy it. If it doesn't work, then just set its value to the username of a user which definitely exists on the org (likely System Admin).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .