Reputation: 11
Ihave some action thet if I try to do it in the sandbox it succeeded but when I tryed to do it in the production it failed I'm looking for somethin thet can help find the difference between the two environments tenks
Upvotes: 1
Views: 2259
Reputation: 46
If you want to know that about current environment you can query IsSandbox field from Organization object.
[select IsSandbox from Organization limit 1];
IsSandbox Indicates whether the current organization is a sandbox (true) or production (false) instance.
similarly you can use it in flows and other automation tools
Upvotes: 1
Reputation: 19612
The question is too vague. Do you know how to capture debug logs and read them?
Could be many things - a validation rule or required field added in prod but not in sandbox. Could be a problem with some integration. Could be that the action silently calls something from a managed package and you don't have a license in production. Could be that the action checks your user's Role/Profile/permissions and something's missing. Could be some reference data missing. A flow/process builder that's deployed from sandbox but not activated.
There are some tools for comparing 2 environments (Gearset, OwnBackup...) or if you're a developer you could download the projects with sfdx/vscode and compare them with something like Winmerge.
Upvotes: 1