I have below post install script class which is used to insert a demo login details for our application.
global class PostInstallClass implements InstallHandler {
global void onInstall(InstallContext context) {
if(context.previousVersion() == null) {
ns__config__c info = new ns__config__c(); //Private Custom Setting.
info.ns__jwtToken__c = '';
info.Name = 'loginUserName';
info.ns__password__c = 'Admin123';
info.ns__eSign_Url__c = 'https://domain.ourapplication.com/';
info.ns__domain__c = 'domain';
insert info;
ns__testCustom__c test = ns__testCustom__c.getOrgDefaults();//public custom setting.
test.ns__testName__c = 'test user';
insert test;
}
}
}
I did added this class to managed package POST INSTALL SCRIPT. To test if is working, I have added normal public custom setting and inserted it. Seems like it's not getting executed at all. am I missing anything?? Please help. Thank you.
{}
to format the code