You need to sign in to do that
Don't have an account?

Test Method failing after adding a validation rule
our salesforce admin added a validation rule on opportunity object and because of which previously working test methods started failing. The validation rule checks if the account has HeadQuarters and its defined as
ISNULL( HQ_Account_Region__c)
When I am trying to move my trigger changes (on a different object), triggers related to opportunity fail because of the above validation rule.
here is the test method. can anyone say whats missing here. I have tried adding a HQ_ACCount_region but its a read only field, so I cannot assing any values to it.
pls.let me know where I am going wrong or how to avoid the error
testOpportunitySalesGoalSyncTime.testMethodOpportunitySalesGoal System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The account is missing primary billing address so this opportunity will not be routed properly. To fix it, please go to the account record and add a primary billing address.: [AccountId]
This is the error message the above validatio rulehas
The account is missing primary billing address so this opportunity will not be routed properly. To fix it, please go to the account record and add a primary billing address.: [AccountId]
Let me know if you have more questions in order to fix this issue
Download Apexpublic class testOpportunitySalesGoalSyncTime { } |
public
\
check whether createAccount method is returning a record (not null) and is there any trigger on opporutnity. If it is then send the code for trigger.