function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SkottypSkottyp 

Deployment keeps Failing

I have been working on launching some apex classes and triggers. The code works and all the tests pass when in the test environment, however when I try to move it to production it fails. I thought something may have changed in my production environment so I refreshed another test environment and deployed to that environment with no issues. What else can I do to try to find the issue?

Thanks in advance for the help.
SabrentSabrent
In Setup > Deployment Status you should be able to see deployment error, that would give you an insight into why your deployment is failing in production. 
SkottypSkottyp
Thanks for Answering Rov.

The error states that one of the fields in my test code was not populated, but why didn't I get that same error deploying to another test company that was refreshed from production today?

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AtlantaDataTransfer: execution of BeforeInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Quota__c]: [Quota__c] Trigger.AtlantaDataTransfer: line 19, column 1: [] 
Stack Trace: Class.TestCreateSFData.createAtlantaDSData: line 504, column 1 Class.TestDistributorSalesDataTransfer.myAtlanta: line 59, column 1
SabrentSabrent
There are three ways to make Custom Fields required -   Field level requirements, On the Page Layout and Validation Ruleeeee
Compare the Quota__c field in your test environment and production environment for each of the above. 
Seems like in production you have it required but not in the test environment. 
I would first start with checking your page layouts.