Formulas contained in Process Builder flows are saved with an invalid namespace for components created by a base package
Last updated 2022-02-10 ·Reference W-4652190 ·Reported By 7 users
When working in the development org for an extension package, you can create a Process Builder flow that uses a formula to reference components (such as fields) in the base package. When the package is uploaded from the main packaging org, the formula will reference the base package namespace prefix as expected.
However, if a patch org is created from the extension package, the formula field contains a reference to the incorrect namespace. Instead of the expected base package namespace prefix, the formula will contain the extension package namespace prefix.
1. Create two developer orgs, and submit a support ticket to enable Patch Orgs in the extension package.
Base Dev Org
Extension Dev Org with Patch Orgs enabled.
In Base Dev Org
2. Create at least one component type that can be referenced in a Process Builder flow formula. For example,
Navigate to Setup | Customize | Contact | Fields and create a custom field (text field: Base_Text__c).
3. Navigate to Setup | Create | Packages, apply namespace (W4652190Base) to the org, create a new managed package, add your custom field, and upload a released version.
In Extension Dev Org
4. Install the base package you just created.
5. Setup | Create | Objects, Create a new custom object (CustomObj__c) and two custom fields:
- Lookup into the object used in Step 2 above. For example, a lookup into Contact (Contact__c)
- Create another field that can be used in the formula. For example, a Percentage field (ExtPercent__c)
6. Setup | Create | Workflows | Process Builder
7. Create a new process builder flow:
a. New > Name > A record changed > Save
b. Add your custom object (CustomObj__c) as the Object, set the rest of the values as desired, and save
c. Add criteria, give it a name, set the criteria as desired, save
d. Add Action, Update Record, Name, update the record that started your process
In the values, choose:
Value: Any formula that calls the field from your base package.
8. Navigate to Setup | Create | Packages, apply namespace (W4652190Ext), create a new managed package, add your Flow Definition (and its components), and upload a released version.
9. Create a Patch Org from the released version of your extension package.
10. Login to the patch org, and navigate to Setup | Create | Packages | Your Package | Upload
You will see the following errors
Flow Definition Process The formula expression is invalid: Field myVariable_current.W4652190Ext__Contact__c.W4652190Ext__Base_Text__c does not exist. Check spelling.
Flow Definition Process The element has an invalid reference to "myVariable_current.W4652190Ext__Contact__c.W4652190Ext__Base_Text__c"
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.