I am performing a deployment from one sandbox to another using ant. The sandboxes both have PersonAccount
functionality enabled. The source org has a PersonAccount
record type with the name of HCP
and in this source org there is a workflow rule and a field update action which sets the RecordType to HCP
after create/update on the record based on the value of another field.
My problem is that the deployment to the target org fails with an error on the workflow action, that the Account
object does not have a RecordType
of HCP
defined on it. This is semi-accurate as the RecordType
is technically defined on the PersonAccount
object and it does exist in the package.xml and the file source as noted below.
Component Failures:
1. workflows/Account.workflow (Account.SetAccount_HCPRecordType) -- Error: In field: lookupValue - no RecordType named Account.HCP found
PersonAccount.object
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<compactLayoutAssignment>SYSTEMPersonAccount</compactLayoutAssignment>
<recordTypes>
<fullName>HCP</fullName>
<active>true</active>
My first attempt at a workaround was to pre-create the HCP
record type manually in the target org on the Person Account and try the deployment again. This failed. Same error.
The only way that I was able to get a successful deployment of this package was to edit the Account.object
file and remove the offending <rules>
and <fieldUpdates>
elements so that there was no reference in the package to the HCP
record type on the PersonAccount
.
- Is this a bug or expected behavior?
- What is the proper way to deploy workflow rules that are dependent on PersonAccount record types?
All files involved are SFDC API v.29