You need to sign in to do that
Don't have an account?
sudha76
Deploying Trigger without Test class.
Is it possible that a Trigger can be deployed on the production without test class. I have on Trigger which was built in 2009 and I do not see any test class associated to it on the production.
I find this weird, can Sales force allow that?
This Trigger looks like this:-
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
trigger AccountCreateTrigger on Account (before insert) {
for (Account acc: Trigger.new)
{Account [] accs = [SELECT Name FROM Account WHERE Name = :acc.Name LIMIT 1];
if (accs.size() > 0 ) //if account already exists, block and show the information on the page
{acc.addError('Account \'' + accs[0].Name + '\' already exists. Please use existing account or contact your Salesforce Administrator for assistance.'); }
}
}
a Trigger without a test class is not possible, but in your case as this is only creation of account, there might be some test class which is creating an Accout and thus covering this trigger as well.
Let me know if this helps.
Cheers!!
Sanjay
All Answers
a Trigger without a test class is not possible, but in your case as this is only creation of account, there might be some test class which is creating an Accout and thus covering this trigger as well.
Let me know if this helps.
Cheers!!
Sanjay
Yes..salesforce do allow us to deploy code without test classes. You have to contact salesforce for that.
yes, this is correct.
I noticed in a different trigger an account is being created but it has no reference to this trigger. so maybe it is covered in the same.
thanks