You need to sign in to do that
Don't have an account?
Rasha Luice
Deploying from sandbox to Production fails
The issue that I'm facing started a month and half ago. Every time one of our org user creates an opportunity, another prospection opp is automatically created. The way it worked before was, we have a Clone automatically checkbox and its value is defaulted to checked. If the user unchecked this box, the prospecting opp would not be created. And now if we check or uncheck this checkbox, the prospecting opp is created anyways.
I checked the triggers that creates the prospecting opp and found the block of code that creates the prospecting opp when the trigger is fired. On the Sandbox, when I comment that line of code and create an opportunity for testing, no matter if I check or uncheck the Clone automatically checkbox, it doesn't create the prospecting opp. And as soon as I go back to the trigger code and uncomment that line, it creates a prospecting opp if I uncheck the checkbox.
So what I decided to do is to comment the one line of code, deploy the change from Sandbox to Production, and then hide the field from the users' profiles but the deployment failed twice.
Errors I'm getting are:
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContactChangeAfter: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Individual Contact Record Type: this ID value isn't valid for the user: : [RecordTypeId] Trigger.ContactChangeAfter: line 16, column 1
Stack Trace: Class.CampaignWebServices.Test_Campaign_Dedupe: line 81, column 1
System.Exception: Assertion Failed
Stack Trace: Class.OppClone.TestCloneOrgOpp: line 113, column 1
Can you please guide me to solve this issue?
Thanks,
I checked the triggers that creates the prospecting opp and found the block of code that creates the prospecting opp when the trigger is fired. On the Sandbox, when I comment that line of code and create an opportunity for testing, no matter if I check or uncheck the Clone automatically checkbox, it doesn't create the prospecting opp. And as soon as I go back to the trigger code and uncomment that line, it creates a prospecting opp if I uncheck the checkbox.
So what I decided to do is to comment the one line of code, deploy the change from Sandbox to Production, and then hide the field from the users' profiles but the deployment failed twice.
Errors I'm getting are:
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContactChangeAfter: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Individual Contact Record Type: this ID value isn't valid for the user: : [RecordTypeId] Trigger.ContactChangeAfter: line 16, column 1
Stack Trace: Class.CampaignWebServices.Test_Campaign_Dedupe: line 81, column 1
System.Exception: Assertion Failed
Stack Trace: Class.OppClone.TestCloneOrgOpp: line 113, column 1
Can you please guide me to solve this issue?
Thanks,
Error #1
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContactChangeAfter: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Individual Contact Record Type: this ID value isn't valid for the user: : [RecordTypeId] Trigger.ContactChangeAfter: line 16, column 1
Stack Trace: Class.CampaignWebServices.Test_Campaign_Dedupe: line 81, column 1
*Here's the code:
Line 16
Line 81
Error #2
System.Exception: Assertion Failed
Stack Trace: Class.OppClone.TestCloneOrgOpp: line 113, column 1
* Here's a snapshot of the method
Please let me know if I'm not using this thread correctly.
Thanks!