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
Chris Kwong 7Chris Kwong 7 

SFDX Push and Deploying Connected Apps Metadata to Scratch Org has an invalid data entry error

We have recently decided to convert from using the traditional Salesforce Project where we defined metadata packaging through via package.xml and migrating it to SFDX. For this task in our SFDX project, we are required to deploy 5 specific connected apps into scratch orgs when we are building our salesforce project for development and testing purposes.

We have used sfdx force:source:push cli to push the code into the scratch org.

The current situation is that we are able to deploy the 5 connected Apps into our org however, 2 of the 5 connected apps are having issues where you cannot edit their API settings or View them through the app/mgmt/forceconnectedapps/forceAppDetail. Url where you can view their API oath configs.  The other 3 connected apps are functioning perfectly fine.

When we deploy the connected apps into our scratch org
1. Go to Apps
2. Go into the connected App that has some metadata error.
3. We get a “Data Not Available” error

User-added image

4. Go back to the Connected Apps section
5. Click edit on either Assured Download Service or Assured PackOut click the save button
6. Click Save
8. I get a “A general data error occurred with your entries” error

User-added image

Here’s the metadata format we deployed and only 3 of the 5 of them are working.

Connected App A format (2 connected Apps) 1 of the 2 apps is not working
—————————— 
<?xml version="1.0" encoding="UTF-8"?>
<ConnectedApp xmlns="http://soap.sforce.com/2006/04/metadata">
    <canvasConfig>
        <accessMethod>Post</accessMethod>
        <canvasUrl>*inserturl</canvasUrl>
        <locations>Visualforce</locations>
        <samlInitiationMethod>None</samlInitiationMethod>
    </canvasConfig>
    <contactEmail>insertEmailHere</contactEmail>
    <contactPhone>#-###-####-####</contactPhone>
    <description>DescriptionA</description>
    <label>ConnectedAppAName</label>
    <oauthConfig>
        <callbackUrl>insertcallbackurl</callbackUrl>
        <scopes>Full</scopes>
    </oauthConfig>
</ConnectedApp>
Connected App B format (2 connected Apps) 1 of the 2 apps is not working.
—————————— 
<?xml version="1.0" encoding="UTF-8"?>
<ConnectedApp xmlns="http://soap.sforce.com/2006/04/metadata">
    <contactEmail>support@email.com</contactEmail>
    <contactPhone>#-###-###-####</contactPhone>
    <description>DescriptionB</description>
    <label>ConnectedAppBName</label>
    <oauthConfig>
        <callbackUrl>insertcallbackurl</callbackUrl>
        <scopes>Api</scopes>
        <scopes>RefreshToken</scopes>
    </oauthConfig>
</ConnectedApp>
Connected App C format (1 connected App) This one is working
—————————— 
<?xml version="1.0" encoding="UTF-8"?>
<ConnectedApp xmlns="http://soap.sforce.com/2006/04/metadata">
    <contactEmail>support@email.com</contactEmail>
    <contactPhone>#-###-###-####</contactPhone>
    <description>DescriptionC</description>
    <label>ConnectedAppCName</label>
    <oauthConfig>
        <callbackUrl>insertcallbackurl</callbackUrl>
        <scopes>Api</scopes>
        <scopes>Chatter</scopes>
        <scopes>RefreshToken</scopes>
    </oauthConfig>
</ConnectedApp>
Any suggestions, help or general fix for this will be appreciated.
Jordan SewellJordan Sewell

I have the exact same issue. I am going to open a case today as well as continue to mess around with it until a solution arises. 

Did you happen to resolve it?

-Jimmy