You need to sign in to do that
Don't have an account?
arun thakur
InstallHandler-specified apex code not running during package instillation
We are trying to insert some records in lead object but APEX code that implement this interface not executing during manage package installation ,Please review my code and advise us
global class InstallClass implements InstallHandler
{
global void onInstall(InstallContext context)
{
if(context.previousVersion() == null) {
lead ObjLead=new Lead();
ObjLead.LastName='InstallClass';
ObjLead.Company='InstallClass';
insert ObjLead;
}
}
public static testMethod void testRunAs()
{
Test.testInstall(new InstallClass(),null);}
}
Is the PostInstall script on the Package Detail screen?
Yes we have this script in our "Package Detail screen"
Do you know if the script is running at all, or is that the lead creation is failing? Have you tried something else aside from the lead creation - e..g sending an email?