• coolkrish
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 16
    Replies
Hi,
I am not getting code coverage for the trigger lines below in bold:
Any help appreciated.

trigger RR_Terr_Inactive_After_Ins_Upd on RRTerritory__c (after insert,after update) {

    List<Id> TerrIds = new List<Id>();
    
    if(Trigger.isUpdate){
        for (RRTerritory__c ter : Trigger.New) { 
        RRTerritory__c  oldTer = Trigger.Oldmap.Get(ter.Id);
        
        if (ter.Status__c == 'Inactive' && oldTer.Status__c != ter.Status__c){         
            TerrIds.add(ter.Id);            
        }  
            }        
                }    
 
    if(TerrIds != null && !TerrIds .isEmpty()) {         
        
        List<RREmployee_Territory__c> empTerList = new List<RREmployee_Territory__c>([SELECT Id,End_Date__c FROM RREmployee_Territory__c WHERE Territory__c     IN:TerrIds AND Active__c = TRUE]);        
        List<RREmployee_Territory__c> empTerList1 = new List<RREmployee_Territory__c>();
        
        for (RRTerritory__c  ter : Trigger.New){         
            for(RREmployee_Territory__c et: empTerList) {          
                     et.Active__c = FALSE;                 
                       et.End_Date__c = ter.Effective_End_Date__c;  
                 
                    empTerList1.add(et);            

            }
        }        
         
        if(empTerList1 != null && !empTerList1.isEmpty()){
                update empTerList1;
        }   
       
    }
}

Test class:

@isTest
public class RR_Territory_Inactive_Test {    
    public static testMethod void runTestCases() { 
        try  {           
            
            //Insert Territory
            RRTerritory__c terr1 = new RRTerritory__c();
            terr1.Territory_ID__c='123';
            terr1.Name = 'New Territory';
            terr1.Franchise__c = 'franc1';
            terr1.Effective_Start_Date__c = System.today().addDays(-10);
            terr1.Status__c = 'Active';
            insert terr1;
            System.assertEquals('New Territory', terr1.Name);     
            
            //Insert RREmployee__c     
            RREmployee__c emp = new RREmployee__c();
            emp.First_Name__c='Test';
            emp.Last_Name__c='Emp';
            emp.Name = 'Test emp';
            emp.Franchise__c = 'test franchise';
            emp.Territory_ID__c ='100'; 
            insert emp;
            System.assertEquals('Test emp', emp.Name);            
                        
            terr1.Status__c = 'Inactive';         
            terr1.Effective_End_Date__c = System.today().addDays(1);
            update terr1;
       
        }catch(DmlException e){
            System.debug('Exception Occurred: '+ e.getMessage());            
        }        
    }    

}
Hi,

I am invoking a wrapper class to display fields from multiple objects in a pop-up window.
I am getting Attempt to de-reference a null object error at line 22.Please help.
Below is the apex class and VFP:

apex class:

public class show_RepAccess_GILD {

    public List<wrapper> wrapperList {get; set;}
    public List<TSF_vod__c> tsfList = new List<TSF_vod__c>();
    public List<User> listOfUsrs = new List<User>();
    List<String> TerrNames = new List<String>();
    List<Id> TerrIds = new List<Id>();
    public  id accid{get;set;}
 

    public show_RepAccess_GILD(ApexPages.StandardController controller)
     {
        accid = ApexPages.currentPage().getParameters().get('id');
          fetchTSFList();
         System.debug('v tsfList:' + tsfList);
         System.debug('v listOfUsrs:' + listOfUsrs);
        
         if(tsfList.size()>0) {
           for(TSF_vod__c tsf : tsfList)
             {
            wrapper w = new wrapper(tsf);                    
            wrapperList.add(w);                        
            }  
         }
         
        
         if(listOfUsrs.size()>0) {
             for(User usr: listOfUsrs)
            {
            wrapper w = new wrapper(usr);
            wrapperList.add(w);
            }             
         }
        
     }
    
    public void fetchTSFList(){
           
        Map<Id, Id> mapUsrTerr = new Map<Id, Id>();                
        List<UserTerritory> listOfUsrTerrsIds = new List<UserTerritory>();
            
            tsfList =[select Territory_vod__c,Rep_Access_GILD__c from TSF_vod__c where Account_vod__c = :accid ];
               for(TSF_vod__c tl:tsfList) {
                   TerrNames.add(tl.Territory_vod__c);             
               }
                   
           //Query in Territory Object for Ids
            List<Territory> listOfTerrs = [SELECT Id FROM Territory WHERE Name IN :TerrNames];
           
           for(Territory tr : listOfTerrs){
              TerrIds.add(tr.Id);             
            }   
           
            //Query in UserTerritory Object for User Ids
            listOfUsrTerrsIds = [SELECT Id,UserId  FROM UserTerritory WHERE TerritoryId IN :TerrIds];
    
            for(UserTerritory ut : listOfUsrTerrsIds){
              mapUsrTerr.put(ut.Id, ut.UserId);         
            }   
            //Query in User Object for the name of user
               listOfUsrs = [SELECT Name FROM User WHERE Id IN :mapUsrTerr.values()]; 
        }    
        
        
        public class wrapper
        {
            public TSF_vod__c tsf     {get; set;}
            public User usr         {get;set;}
        
            public wrapper(TSF_vod__c tsf)
            {
                this.tsf = tsf;
            }
    
            public wrapper(User usr)
            {
                this.usr = usr;
            }    
        }

    }

VFP:

<apex:page standardController="Account"  extensions="show_RepAccess_GILD" showHeader="false" sidebar="false" setup="false"  docType="html-5.0">
<apex:form >
 
     <apex:dataTable value="{!wrapperList}" var="wrapper" >
    <apex:column >
        <apex:facet name="header">Rep Access</apex:facet>
        {!wrapper.tsf.Rep_Access_GILD__c}
    </apex:column>
    <apex:column >
        <apex:facet name="header">Rep Name</apex:facet>
        {!wrapper.usr.Name}
    </apex:column>
</apex:dataTable>          

 </apex:form>
</apex:page>
 
Hi,

We are trying to send a simple outbound message from Call object and when I test the outbound message using putsreq.com, I see duplicate notification elements in the outbound XML.Any clue is appreciated.

Below is the XML that's generated.

<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <notifications xmlns="http://soap.sforce.com/2005/09/outbound"> <OrganizationId>00D29000000DChKEAW</OrganizationId> <ActionId>04k2900000000VsAAI</ActionId> <SessionId>00D29000000DChK!ARQAQBQFYvinET90bNEJmZuONAzXWpBITdyw.Q7rB4.MG1tFRjav72M.7R41lFGuTPKkE5MUOqpKXkvSxqhtLSvHdEm6kgpd</SessionId> <EnterpriseUrl>https://cs19.salesforce.com/services/Soap/c/41.0/00D29000000DChK</EnterpriseUrl> <PartnerUrl>https://cs19.salesforce.com/services/Soap/u/41.0/00D29000000DChK</PartnerUrl> <Notification> <Id>04l29000007rcl0AAA</Id> <sObject xsi:type="sf:Call2_vod__c" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"> <sf:Id>a0429000003NfBHAA0</sf:Id> </sObject> </Notification> <Notification> <Id>04l29000007rckzAAA</Id> <sObject xsi:type="sf:Call2_vod__c" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"> <sf:Id>a0429000003NfBCAA0</sf:Id> </sObject> </Notification> </notifications> </soapenv:Body> </soapenv:Envelope>
Hi,

I am trying to pass a selected record in a related list to controller from VFP.
I am getting error: Unknown constructor 'RR_Multi_Emp_Trainings.RR_Multi_Emp_Trainings(ApexPages.StandardController controller)'

apex class:

public class RR_Multi_Emp_Trainings {   
          
  public  ApexPages.StandardSetController setCon;
        
    public RR_Multi_Emp_Trainings(ApexPages.StandardSetController controller) {
           setCon = controller;
               }    
    
public integer getMySelectedSize() { 
return setCon.getSelected().size(); 


public integer getMyRecordsSize() { 
return setCon.getRecords().size(); 


}

VFP:

<apex:page standardController="RREmployee_Trainings__c" extensions="RR_Multi_Emp_Trainings" showHeader="false" sidebar="false" setup="false">

</apex:page>

Please help.

Thanks,
Krishna.
Hi,

I am  trying to make a field conditionally required in visual force page as below but it is not working:

<apex:inputfield value="{!Account.NPI_vod__c}" required="{!IF(Account.Credentials_vod__c= 'DO', true, false)}" />

Please advise.

Thanks,
Krishna.
Hi,

I am trying to get code coverage for catch block.

 try {
                update empMap.values();
              } catch(Exception e) {
                Trigger.new.get(0).addError('Unable to update address details on Account');
            }     

this is my test calss:

@isTest
public class RRAddress_Copy_To_Employee_Test {    
    public static testMethod void runTestCases() { 
        try  {
        //Insert RREmployee__c 
        RREmployee__c emp = new RREmployee__c();
        emp.First_Name__c='Test';
          emp.Last_Name__c='Emp';
        emp.Name = 'Test emp';
        emp.Franchise__c = 'test franchise';
        emp.Territory_ID__c ='100';
        insert emp;
        System.assertEquals ('Test emp', emp.Name);
        
        // insert Address
        RRAddress__c addr1 = new RRAddress__c();
        addr1.Employee__c = emp.Id;
        addr1.Type__c = 'Sampling';
        addr1.Name ='street line1';
        addr1.Address_Line_2__c='Street Line2';
        addr1.Address_Line_3__c='Street Line3';
        addr1.City__c = 'Sunnyvale';
        addr1.State__c = 'CA';
        addr1.Zip__c ='99999';
        addr1.Country__c ='USA';
        
        insert addr1;
        
        System.assertEquals ('street line1', addr1.Name);
        
        // update Address        
        addr1.Type__c = 'Sampling';
        addr1.Name ='street line11';
        addr1.Address_Line_2__c='Street Line22';
        addr1.Address_Line_3__c='Street Line33';
        addr1.City__c = 'Mountain View';
        addr1.State__c = 'TN';
        addr1.Zip__c = '99999';
        addr1.Country__c ='CAN';
        
        update addr1;
        System.assertEquals ('street line11', addr1.Name);
        }catch(DmlException e){
            System.assert(e.getMessage().contains('Unable to update address details on Account'),e.getMessage());
            //System.debug('Exception Occurred: '+ e.getMessage());            
        }        
    }    

Please advise.

Thanks,
Krishna.
Hi,

I am trying to create a time dependent workflow action to send an email to the creator after one hour if the status remains "In progress"
I see the entry in the monitoring queue but nothing is happening after the "Scheduled Date"

WF evaluation criteria is "Created"

Thanks,
Krishna.
Hi,

I am trying to embed a visual force page on a page layout.
VFP should display an external URL in a frame.

I am trying to use 

<apex:iframe src="http://www.salesforce.com" scrolling="true" id="theIframe"/>

Is this still supported or Is there an alternate way of doing this?

Please advise.

Thanks,
Krishna.
Hi,

I am trying to automate cleaning and creating batch jobs as part of post sandbox refresh activity.
I am unable to get code coverage for the line "System.abortJob()"
Code below:

global class GRScheduledJobsAutomation implements SandboxPostCopy { 
    global GRScheduledJobsAutomation() { }
    global void runApexClass(SandboxContext context) { 
    
    // Delete all the gRoster batch jobs
    List<CronJobDetail> cjDtlLst = [SELECT Id FROM CronJobDetail WHERE Name LIKE 'GR%'];        
    List<CronTrigger> ctLst = [SELECT Id FROM CronTrigger WHERE CronJobDetailId IN :cjDtlLst];    
    for(CronTrigger ct:ctLst){
        System.abortJob(ct.Id);
    }
        
    //Create gRoster batch jobs
    RR_SCHED_EmpTerrAct at= new RR_SCHED_EmpTerrAct();
    String cronStr1 = '0 55 * * * ?';
    System.schedule('GR 1', cronStr1, at);
    
    RR_SCHED_ActEmpRole ae= new RR_SCHED_ActEmpRole ();
    String cronStr2 = '0 0 01 * * ?';
    System.schedule('GR 2', cronStr2, ae);
    
    RR_SCHED_VacEmpTerrCrea vt= new RR_SCHED_VacEmpTerrCrea();
    String cronStr3 = '0 0 01 ? * 1-7';
    System.schedule('GR 3', cronStr3, vt);             
       
}
 
}

Test class:
@isTest
public class GR_SCHED_Jobs_Auto_Test {
public static testMethod void testSandboxPostCopyScript() {
 
    GRScheduledJobsAutomation GRJobAuto = new GRScheduledJobsAutomation(); 
    Test.testSandboxPostCopyScript(GRJobAuto, null, null, null); 
    System.assertEquals(3, [SELECT count() FROM CronJobDetail]);       
    
}
}

Please advise how to get code coverage to that line.

Thanks,
Krishna.
 

 
Hi,
I am not getting code coverage for the trigger lines below in bold:
Any help appreciated.

trigger RR_Terr_Inactive_After_Ins_Upd on RRTerritory__c (after insert,after update) {

    List<Id> TerrIds = new List<Id>();
    
    if(Trigger.isUpdate){
        for (RRTerritory__c ter : Trigger.New) { 
        RRTerritory__c  oldTer = Trigger.Oldmap.Get(ter.Id);
        
        if (ter.Status__c == 'Inactive' && oldTer.Status__c != ter.Status__c){         
            TerrIds.add(ter.Id);            
        }  
            }        
                }    
 
    if(TerrIds != null && !TerrIds .isEmpty()) {         
        
        List<RREmployee_Territory__c> empTerList = new List<RREmployee_Territory__c>([SELECT Id,End_Date__c FROM RREmployee_Territory__c WHERE Territory__c     IN:TerrIds AND Active__c = TRUE]);        
        List<RREmployee_Territory__c> empTerList1 = new List<RREmployee_Territory__c>();
        
        for (RRTerritory__c  ter : Trigger.New){         
            for(RREmployee_Territory__c et: empTerList) {          
                     et.Active__c = FALSE;                 
                       et.End_Date__c = ter.Effective_End_Date__c;  
                 
                    empTerList1.add(et);            

            }
        }        
         
        if(empTerList1 != null && !empTerList1.isEmpty()){
                update empTerList1;
        }   
       
    }
}

Test class:

@isTest
public class RR_Territory_Inactive_Test {    
    public static testMethod void runTestCases() { 
        try  {           
            
            //Insert Territory
            RRTerritory__c terr1 = new RRTerritory__c();
            terr1.Territory_ID__c='123';
            terr1.Name = 'New Territory';
            terr1.Franchise__c = 'franc1';
            terr1.Effective_Start_Date__c = System.today().addDays(-10);
            terr1.Status__c = 'Active';
            insert terr1;
            System.assertEquals('New Territory', terr1.Name);     
            
            //Insert RREmployee__c     
            RREmployee__c emp = new RREmployee__c();
            emp.First_Name__c='Test';
            emp.Last_Name__c='Emp';
            emp.Name = 'Test emp';
            emp.Franchise__c = 'test franchise';
            emp.Territory_ID__c ='100'; 
            insert emp;
            System.assertEquals('Test emp', emp.Name);            
                        
            terr1.Status__c = 'Inactive';         
            terr1.Effective_End_Date__c = System.today().addDays(1);
            update terr1;
       
        }catch(DmlException e){
            System.debug('Exception Occurred: '+ e.getMessage());            
        }        
    }    

}
Hi,

I am invoking a wrapper class to display fields from multiple objects in a pop-up window.
I am getting Attempt to de-reference a null object error at line 22.Please help.
Below is the apex class and VFP:

apex class:

public class show_RepAccess_GILD {

    public List<wrapper> wrapperList {get; set;}
    public List<TSF_vod__c> tsfList = new List<TSF_vod__c>();
    public List<User> listOfUsrs = new List<User>();
    List<String> TerrNames = new List<String>();
    List<Id> TerrIds = new List<Id>();
    public  id accid{get;set;}
 

    public show_RepAccess_GILD(ApexPages.StandardController controller)
     {
        accid = ApexPages.currentPage().getParameters().get('id');
          fetchTSFList();
         System.debug('v tsfList:' + tsfList);
         System.debug('v listOfUsrs:' + listOfUsrs);
        
         if(tsfList.size()>0) {
           for(TSF_vod__c tsf : tsfList)
             {
            wrapper w = new wrapper(tsf);                    
            wrapperList.add(w);                        
            }  
         }
         
        
         if(listOfUsrs.size()>0) {
             for(User usr: listOfUsrs)
            {
            wrapper w = new wrapper(usr);
            wrapperList.add(w);
            }             
         }
        
     }
    
    public void fetchTSFList(){
           
        Map<Id, Id> mapUsrTerr = new Map<Id, Id>();                
        List<UserTerritory> listOfUsrTerrsIds = new List<UserTerritory>();
            
            tsfList =[select Territory_vod__c,Rep_Access_GILD__c from TSF_vod__c where Account_vod__c = :accid ];
               for(TSF_vod__c tl:tsfList) {
                   TerrNames.add(tl.Territory_vod__c);             
               }
                   
           //Query in Territory Object for Ids
            List<Territory> listOfTerrs = [SELECT Id FROM Territory WHERE Name IN :TerrNames];
           
           for(Territory tr : listOfTerrs){
              TerrIds.add(tr.Id);             
            }   
           
            //Query in UserTerritory Object for User Ids
            listOfUsrTerrsIds = [SELECT Id,UserId  FROM UserTerritory WHERE TerritoryId IN :TerrIds];
    
            for(UserTerritory ut : listOfUsrTerrsIds){
              mapUsrTerr.put(ut.Id, ut.UserId);         
            }   
            //Query in User Object for the name of user
               listOfUsrs = [SELECT Name FROM User WHERE Id IN :mapUsrTerr.values()]; 
        }    
        
        
        public class wrapper
        {
            public TSF_vod__c tsf     {get; set;}
            public User usr         {get;set;}
        
            public wrapper(TSF_vod__c tsf)
            {
                this.tsf = tsf;
            }
    
            public wrapper(User usr)
            {
                this.usr = usr;
            }    
        }

    }

VFP:

<apex:page standardController="Account"  extensions="show_RepAccess_GILD" showHeader="false" sidebar="false" setup="false"  docType="html-5.0">
<apex:form >
 
     <apex:dataTable value="{!wrapperList}" var="wrapper" >
    <apex:column >
        <apex:facet name="header">Rep Access</apex:facet>
        {!wrapper.tsf.Rep_Access_GILD__c}
    </apex:column>
    <apex:column >
        <apex:facet name="header">Rep Name</apex:facet>
        {!wrapper.usr.Name}
    </apex:column>
</apex:dataTable>          

 </apex:form>
</apex:page>
 
Hi,

I am trying to pass a selected record in a related list to controller from VFP.
I am getting error: Unknown constructor 'RR_Multi_Emp_Trainings.RR_Multi_Emp_Trainings(ApexPages.StandardController controller)'

apex class:

public class RR_Multi_Emp_Trainings {   
          
  public  ApexPages.StandardSetController setCon;
        
    public RR_Multi_Emp_Trainings(ApexPages.StandardSetController controller) {
           setCon = controller;
               }    
    
public integer getMySelectedSize() { 
return setCon.getSelected().size(); 


public integer getMyRecordsSize() { 
return setCon.getRecords().size(); 


}

VFP:

<apex:page standardController="RREmployee_Trainings__c" extensions="RR_Multi_Emp_Trainings" showHeader="false" sidebar="false" setup="false">

</apex:page>

Please help.

Thanks,
Krishna.
Hi,

I am  trying to make a field conditionally required in visual force page as below but it is not working:

<apex:inputfield value="{!Account.NPI_vod__c}" required="{!IF(Account.Credentials_vod__c= 'DO', true, false)}" />

Please advise.

Thanks,
Krishna.
Hi,

I am trying to get code coverage for catch block.

 try {
                update empMap.values();
              } catch(Exception e) {
                Trigger.new.get(0).addError('Unable to update address details on Account');
            }     

this is my test calss:

@isTest
public class RRAddress_Copy_To_Employee_Test {    
    public static testMethod void runTestCases() { 
        try  {
        //Insert RREmployee__c 
        RREmployee__c emp = new RREmployee__c();
        emp.First_Name__c='Test';
          emp.Last_Name__c='Emp';
        emp.Name = 'Test emp';
        emp.Franchise__c = 'test franchise';
        emp.Territory_ID__c ='100';
        insert emp;
        System.assertEquals ('Test emp', emp.Name);
        
        // insert Address
        RRAddress__c addr1 = new RRAddress__c();
        addr1.Employee__c = emp.Id;
        addr1.Type__c = 'Sampling';
        addr1.Name ='street line1';
        addr1.Address_Line_2__c='Street Line2';
        addr1.Address_Line_3__c='Street Line3';
        addr1.City__c = 'Sunnyvale';
        addr1.State__c = 'CA';
        addr1.Zip__c ='99999';
        addr1.Country__c ='USA';
        
        insert addr1;
        
        System.assertEquals ('street line1', addr1.Name);
        
        // update Address        
        addr1.Type__c = 'Sampling';
        addr1.Name ='street line11';
        addr1.Address_Line_2__c='Street Line22';
        addr1.Address_Line_3__c='Street Line33';
        addr1.City__c = 'Mountain View';
        addr1.State__c = 'TN';
        addr1.Zip__c = '99999';
        addr1.Country__c ='CAN';
        
        update addr1;
        System.assertEquals ('street line11', addr1.Name);
        }catch(DmlException e){
            System.assert(e.getMessage().contains('Unable to update address details on Account'),e.getMessage());
            //System.debug('Exception Occurred: '+ e.getMessage());            
        }        
    }    

Please advise.

Thanks,
Krishna.
Hi,

I am trying to create a time dependent workflow action to send an email to the creator after one hour if the status remains "In progress"
I see the entry in the monitoring queue but nothing is happening after the "Scheduled Date"

WF evaluation criteria is "Created"

Thanks,
Krishna.
Hi,

I am trying to automate cleaning and creating batch jobs as part of post sandbox refresh activity.
I am unable to get code coverage for the line "System.abortJob()"
Code below:

global class GRScheduledJobsAutomation implements SandboxPostCopy { 
    global GRScheduledJobsAutomation() { }
    global void runApexClass(SandboxContext context) { 
    
    // Delete all the gRoster batch jobs
    List<CronJobDetail> cjDtlLst = [SELECT Id FROM CronJobDetail WHERE Name LIKE 'GR%'];        
    List<CronTrigger> ctLst = [SELECT Id FROM CronTrigger WHERE CronJobDetailId IN :cjDtlLst];    
    for(CronTrigger ct:ctLst){
        System.abortJob(ct.Id);
    }
        
    //Create gRoster batch jobs
    RR_SCHED_EmpTerrAct at= new RR_SCHED_EmpTerrAct();
    String cronStr1 = '0 55 * * * ?';
    System.schedule('GR 1', cronStr1, at);
    
    RR_SCHED_ActEmpRole ae= new RR_SCHED_ActEmpRole ();
    String cronStr2 = '0 0 01 * * ?';
    System.schedule('GR 2', cronStr2, ae);
    
    RR_SCHED_VacEmpTerrCrea vt= new RR_SCHED_VacEmpTerrCrea();
    String cronStr3 = '0 0 01 ? * 1-7';
    System.schedule('GR 3', cronStr3, vt);             
       
}
 
}

Test class:
@isTest
public class GR_SCHED_Jobs_Auto_Test {
public static testMethod void testSandboxPostCopyScript() {
 
    GRScheduledJobsAutomation GRJobAuto = new GRScheduledJobsAutomation(); 
    Test.testSandboxPostCopyScript(GRJobAuto, null, null, null); 
    System.assertEquals(3, [SELECT count() FROM CronJobDetail]);       
    
}
}

Please advise how to get code coverage to that line.

Thanks,
Krishna.
 

 

Hi

I am trying to deploy profiles from sandbox to production. This is not possible because of the error message:

 

 

AProfileName : In field: recordType - no RecordType named idea.Record_type_for_community_091T00000004HfhIAE_entity_Idea found

 

 

I came to the conclusion that this is probably because the sandbox has a test community created (can be found in Customize -> Ideas - Communities). There is one default there named 'Internal Ideas' but in the sandbox there is an additional one.

 

I tried to de-activate the community. Then I removed the sandbox project from Eclipse and then imported it again (under a different name). Still the same error. Furthermore it is not possible to delete communities.

 

Now, what do I do? 

 

The idea has struck me to create a community manually in PROD but I don't think that it will have the same Id as the one in the error message above anyway.

 

Any help appreciated!

 

BR / Niklas

Hey all, 

 

I need your help with trying to create a function that sends emails on a recurring basis. I called support but they werent very clear on how I could do this, so I'm turning to you for help. 


My function should send an email to the assigned user every 2 hour if the case priority is high and the status is new

 

So far I've tried the following but I believe it will not work:

 

 

trigger alertUser on Case (after update, after insert) {
datetime now = datetime.now();
datetime created = case.Createddate;
If (math.mod(datetime.getTime(created)  -  datetime.getTime(now), 7200000) == 0){
//send email
}
} 

 Thanks in advance