"invalid cross reference id" deploying Custom App with profileActionOverrides referencing new profiles in same deployment
AppExchange , Packaging , Metadata , Sandbox , Eclipse IDE , Change Sets
Last updated 2018-05-17 ·Reference W-4056482 ·Reported By 5 users
Summary
When attempting to deploy a Custom App with profileActionOverrides that reference newly created profiles and including both in a deployment may results in the App component throwing the error:
"invalid cross reference id"
When deploying CustomApplication is saved before Profile, so when the CustomApplication is saved, the Ids for the profiles which are newly added in the deployment are not yet available.
If the CustomApplication has ProfileActionOverride, it tries to get profileId but since the profile is not available if it is new, the reference to the profileId becomes null resulting in the "invalid cross reference id" error.
Repro
In Source Org:
1. Create a record type for Account (AccountRT1)
2. Create Record Lightning Page for Account (AccountLightningPage) and save it (just save, do not activate at this moment)
3. Create change set (ChangeSet01), add AccountRT1 and AccountLightningPage, upload it
In Target Org:
4. Deploy ChangeSet01
In Source Org:
5. Enable lightning and switch to lightning UI
6. Create a profile (TestProfile) cloned from StandardUser profile
7. Create a Lightning App (TestApp)
8. Go to AccountLightningPage, activate it, select APP, RECORD TYPE, AND PROFILE tab, assign TestApp, AccountRT1, TestProfile and save it
9. Create change set (ChangeSet02), add TestApp, TestApp_UtilityBar (Lightning Page) and TestProfile, upload it
In Target Org:
10. Enable lightning and switch to Lightning UI
11. Deploy ChangeSet02
Actual Results: The validation failed with the error "invalid cross reference id"
Expected Results: The deployment would be successful without the error.
Workaround
- Create the profiles referenced by the App's profileActionOverrides in the target org before deploying the App.
- Remove the App from the deployment, create it in the target environment and then deploy other components.
Reported By (5)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.