Skip to main content

Deploy Destructive Changes in Salesforce Without Hand-Writing destructiveChanges.xml

· 10 min read
Alina Hubaidullina
Salesforce Consultant

You need to delete a field, an object, or a class from a target org — and your SFDX deploy quietly leaves it in place. A source deploy (sf project deploy start --source-dir, formerly force:source:deploy --sourcepath) deploys the components it finds in your source directory. Removing something is a separate instruction the source format doesn't carry — the manual path is a hand-authored destructiveChanges.xml paired with an empty package.xml and a pre/post ordering flag. mtdt.io turns that into a checkbox: pick what to delete, get the manifest built for you, and choose before-or-after deploy ordering with one radio.

Migrate Org-Wide Defaults and Sharing Rules Between Salesforce Orgs

· 6 min read
Alina Hubaidullina
Salesforce Consultant

Can you move Org-Wide Defaults and Sharing Rules from one Salesforce org to another? Yes — OWD is a value on the object's metadata and sharing rules are a per-object component, so both are deployable; the platform's own tooling just makes it awkward. It's one of the oldest questions on the platform — the most-viewed sharing question on Salesforce StackExchange asks exactly this — and the usual answer is a shrug. Change sets carry OWD invisibly inside the object, treat each object's sharing rules as an all-or-nothing blob, and give no warning when a rule points at a group the target doesn't have.

Deploy Page Layout Assignments in Salesforce — Without Redeploying the Whole Profile

· 6 min read
Alina Hubaidullina
Salesforce Consultant

You want to push one change — a profile should use a different page layout for an object — from one org to the next, ideally across many orgs at once. The short answer: no, you don't need to deploy the whole profile. A page layout assignment is a single entry on the profile (<layoutAssignments>), and the Metadata API upserts a profile per element, so a profile containing just that one assignment deploys fine and leaves the rest of the target profile untouched. That still leaves the questions every admin automating this runs into: will it wipe my other assignments? Do I need the layout and the record types too?

Deploy Picklist Value Changes Between Salesforce Orgs — Inline and Global

· 7 min read
Alina Hubaidullina
Salesforce Consultant

Can you deploy picklist values between Salesforce orgs? Search it and you hit a wall of half-answers: the values seem not to come across, someone tells you to "just deploy the whole object," and global value sets are apparently a separate thing entirely. The short answer is yes — and the confusion comes down to where a picklist's values actually live.

The Best Way to Deploy Profiles in Salesforce — Without Wiping Permissions

· 8 min read
Alina Hubaidullina
Salesforce Consultant

Ask how to deploy a Salesforce profile — the System Administrator profile especially — and you'll get a chorus of warnings: it wipes permissions, it comes over empty, it strips your settings. The fear is earned. The Metadata API reads a profile as a single all-or-nothing document, so the way you deploy it decides whether you ship a clean change or a mass lockout — and the safest way is to scope the profile to only the components you're deploying, so anything you didn't include is never touched on the target.

Deploy Custom Fields in Salesforce Without the 'Not in package.xml' Error

· 4 min read
Alina Hubaidullina
Salesforce Consultant

You deploy a custom object and one of its fields throws … is not in package.xml — even though the object is right there in your manifest. Or the deploy succeeds, but the field never shows up in the target. Both trace back to one fact: a custom field and the object it lives on are separate metadata components, and your deployment has to keep the two in agreement on every field.

Fix 'Unknown user permission: SendExternalEmailAvailable' on a Salesforce Deploy

· 5 min read
Alina Hubaidullina
Salesforce Consultant

You deploy a profile or permission set to another org and Salesforce throws it straight back:

Unknown user permission: SendExternalEmailAvailable

The profile is valid and the permission is real; the target org simply doesn't recognize the name. That's because the permission only exists in an org once the feature behind it is turned on — here, SendExternalEmailAvailable needs Email Deliverability set to "All emails" — and the same cause is behind every "Unknown user permission" error.

Can You Delete a Record Type Through the Metadata API? (And What to Do Instead)

· 5 min read
Alina Hubaidullina
Salesforce Consultant

You want to retire a record type, so you add it to a destructive deployment — and Salesforce throws it right back at you. Record types are one of the few components the Metadata API refuses to delete: put one in destructiveChanges and Salesforce hard-rejects it with Cannot delete record type through API, every time. The supported path instead is to deactivate it — deploy it with <active>false</active> — then delete it manually in Setup once no records reference it.

Deploy FlexiPage Assignments in Salesforce: What Moves Between Orgs (and What Doesn't)

· 7 min read
Alina Hubaidullina
Salesforce Consultant

You build a Lightning page — a FlexiPage — assign it as the record page for an object, deploy it to the next org, and it doesn't show up. The page is there; the assignment isn't. Or you try to move the assignment and the deploy hard-fails instead. The behavior looks random until you see the cause: Salesforce stores a Lightning page assignment separately from the page, across two different metadata types depending on how the page is scoped. Nearly every assignment does deploy through the Metadata API — org defaults on the object, app/profile/record-type activations on the Custom App — as long as you deploy it from the right container; the one exception is a record-type-specific assignment with no app or profile, which has no metadata field to carry it.

Deploying Workflows That Reference Person Account Record Types in Salesforce

· 5 min read
Alina Hubaidullina
Salesforce Consultant

Take a workflow that references a Person Account record type and move it to another org. Sometimes it deploys cleanly; sometimes Salesforce rejects it outright. The deciding factor is how the workflow uses the record type: a rule's entry criteria that filter on the record type deploy without issue, while a field update that tries to set the record type is rejected by Salesforce itself, regardless of the tool you deploy with.