Skip to main content
added 61 characters in body
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59

Edit** I'm nuking this trigger, I have to re write it..

Test Class

Test Class

Edit** I'm nuking this trigger, I have to re write it..

Test Class

added 2 characters in body
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59
@isTest
private class PartnerLeadShare_test {
static testMethod void myUnitTest1() {
List<Lead> leadList = new List<Lead>();
List<LeadShare> leadShareList = new list<LeadShare>(); 

Lead ld = new Lead();
ld.lastName = 'Test Zensar';'Tester';//=/
ld.Company = 'Zensar';'MyCompany';
ld.Status = 'Open';
ld.Program_EAU__c ='11';
insert ld;
system.debug('ld****' +ld);

GroupMember groupMemberStore = [select GroupId,UserOrGroupId from GroupMember limit 1];

LeadShare ls = new LeadShare(); 
ls.LeadId = ld.id;
ls.UserOrGroupId = groupMemberStore.UserOrGroupId ;
ls.LeadAccessLevel = 'Edit';
leadShareList.add(ls);
 
 if(leadShareList.size()>0){
    system.debug('INSIDE LEADSHARE LIST.');
     insert leadShareList;
 }
 }
}
@isTest
private class PartnerLeadShare_test {
static testMethod void myUnitTest1() {
List<Lead> leadList = new List<Lead>();
List<LeadShare> leadShareList = new list<LeadShare>(); 

Lead ld = new Lead();
ld.lastName = 'Test Zensar';
ld.Company = 'Zensar';
ld.Status = 'Open';
ld.Program_EAU__c ='11';
insert ld;
system.debug('ld****' +ld);

GroupMember groupMemberStore = [select GroupId,UserOrGroupId from GroupMember limit 1];

LeadShare ls = new LeadShare(); 
ls.LeadId = ld.id;
ls.UserOrGroupId = groupMemberStore.UserOrGroupId ;
ls.LeadAccessLevel = 'Edit';
leadShareList.add(ls);
 
 if(leadShareList.size()>0){
    system.debug('INSIDE LEADSHARE LIST.');
     insert leadShareList;
 }
 }
}
@isTest
private class PartnerLeadShare_test {
static testMethod void myUnitTest1() {
List<Lead> leadList = new List<Lead>();
List<LeadShare> leadShareList = new list<LeadShare>(); 

Lead ld = new Lead();
ld.lastName = 'Tester';//=/
ld.Company = 'MyCompany';
ld.Status = 'Open';
ld.Program_EAU__c ='11';
insert ld;
system.debug('ld****' +ld);

GroupMember groupMemberStore = [select GroupId,UserOrGroupId from GroupMember limit 1];

LeadShare ls = new LeadShare(); 
ls.LeadId = ld.id;
ls.UserOrGroupId = groupMemberStore.UserOrGroupId ;
ls.LeadAccessLevel = 'Edit';
leadShareList.add(ls);
 
 if(leadShareList.size()>0){
    system.debug('INSIDE LEADSHARE LIST.');
     insert leadShareList;
 }
 }
}
added 181 characters in body
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59

IEdit** I added IsActive = True the trigger user query, no luck.

Edit** I just went talking to anyone that might have an idea about UserTypes, and they have no idea what UserType = 'PowerPartner' is. So I changed it to a different UserType.. didn't work

I added IsActive = True the trigger user query, no luck.

Edit** I added IsActive = True the trigger user query, no luck.

Edit** I just went talking to anyone that might have an idea about UserTypes, and they have no idea what UserType = 'PowerPartner' is. So I changed it to a different UserType.. didn't work

added 55 characters in body
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59
Loading
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59
Loading