+ Start a Discussion
Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student 

Changeset not validating because of old Tests

Hey there,

 

I am attempting to deploy a very important Apex Trigger to production. In sandbox the trigger has a test coverage of 100% and works perfectly. However, upon deploying it failed because of two old tests.

 

This is the error:

 

TESTdestiny_Product_bIbU.myUnitTest() Class 18   Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Destiny_Product__c]", Failure Stack Trace: "Class.TESThelper.__sfdc_testDestiny00: line 18, column 1 Class.TESTdestiny_Product_bIbU.myUnitTest: ... TESTdestiny_Service_bIbU.myUnitTest() Class 18  

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []", Failure Stack Trace: "Class.TESThelper2.__sfdc_testDestiny01: line 18, column 1 Class.TESTdestiny_Service_bIbU.myUnitTest: line 25, column 1"

 

 

 

What can I do?

 

Thankyou

Best Answer chosen by Admin (Salesforce Developers) 
SRKSRK

it seemd like you have enable lookup filter on  "Destiny_Product__c" field

for 1st error you can trun off the filter as of now & you can turn it on back after deployment

 

and for 2nd error u need to modify the test method

All Answers

SRKSRK

it seemd like you have enable lookup filter on  "Destiny_Product__c" field

for 1st error you can trun off the filter as of now & you can turn it on back after deployment

 

and for 2nd error u need to modify the test method

This was selected as the best answer
Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student

How would I modify the test?

Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student

Thankyou for your help. I have solved the problema nd the changesets have deployed. thankyou