• Katie Hamberg
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 14
    Replies
We have a custom object called ‘Inspection’ and whenever ‘Partial’ checkbox field on the object is true the ‘Inspection_Popup’ vf page will invoke from page layout and popup screen will ask for confirmation to create a new inspection record. This functionality was working before but after enabling ‘clickjack protection’ got URL doesn’t exist error. I followed Salesforce recommended suggestions, then the popup is showing off for only 1 second then going off. But when it meets the above mentioned criteria to invoke vf page if I’m on a inspection record and move to any new tab before the popup shows off, then the popup constantly showing on the inspection record until user clicks any button on it.
 
Hi,

I have a custom object that is related to the Contact object.  There are a couple fields (picklist, text, and date) where we want the user to be able to edit it on the custom object or the contact and it will update on both.  Is this possible?

Thanks!
Hi,

I'm looking to add multiple account lookups onto the event page.  I've been given an error that since an account lookup is already on the page, I'm not able to do this.  I've contacted Salesforce and was given the advice to create a visualforce page.  I haven't created a visualforce page before, and was wondering if anyone has come across this issue before.  Thanks much!

Katie
Hi,
We have a current button on a custom object called "Email Contact"  When pressed it goes to the Send an Email screen and the contact field is populated as well as related to.  We have just tried to replicate the formula on a new custom object.  This object has a field called account number, and when that field is populated the formula does not pull in the contact.  Below is the formula used.  Any help would be appreciated.

location.replace('/email/author/emailauthor.jsp?retURL=/{!Ameren_PSP__c.Id}&p3_lkid={!Ameren_PSP__c.Id}&p2_lkid={!Ameren_PSP__c.ContactId__c}&template_id=00X320000019gVx')
Hello,
We have the below trigger that is working for me as an admin, but it's not working for other profiles. What the trigger does is it forces the user to always have an open task until the record is completed.

trigger createNextTask on Task (before update) {
     
   Map<Id,string> whatIds = new Map<Id,string>();
   Set<Id> ECIds = new Set<Id>();
   Set<Id> EPIds = new Set<Id>();
   Map<Id,string> whoIds = new Map<Id,string>();
   set<Id> EI2ContactIds = new Set<Id>();
   set<Id> EI2ProjectIds = new Set<Id>();
   List<Task> EI2tskList = new List<Task>();

   Task EI2tsk;
   private Id eidTaskRecordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Outreach').getRecordTypeId();
  
   if(TriggerHandler.firstRun) {
   
     for(task t:trigger.new){
        if(t.RecordTypeId == eidTaskRecordTypeId){
          string whId = t.WhoId;            
          if(whId!= null && whId.startsWith('003')&& !EI2ContactIds.contains(t.WhoId)){
             EI2ContactIds.add(t.WhoId);
           }
           string whaId = t.WhatId;
           // cnte sandbox id for ISEIF and EI2 Projects is a1Z
           // production id for ISEIF and EI2 Projects is a0Y
           if(whaId!= null && whaId.startsWith('a0Y')&& !EI2ProjectIds.contains(t.WhatId)){
              EI2ProjectIds.add(t.WhatId);
           }
        }     
     } 
     
       
     for(contact c :[select Id,EI2_Act_on_Status__c,ARES_Status__c,Real_Time_Status__c from contact where Id IN :EI2ContactIds  ]){
        if( ( c.EI2_Act_on_Status__c =='Interested'|| c.EI2_Act_on_Status__c == 'Referred')||(c.ARES_Status__c == 'Interested'||c.ARES_Status__c =='Referred')
           ||(c.Real_Time_Status__c == 'Interested'|| c.Real_Time_Status__c == 'Referred')){
               ECIds.add(c.id);
        }
     }      
     for(ISEIF_and_EI2_Projects__c p :[select Id, Project_Status__c, ARES_Status__c, EI2_Project_Status__c From ISEIF_and_EI2_Projects__c where Id IN :EI2ProjectIds ]) {
        if( p.EI2_Project_Status__c=='Active' || p.EI2_Project_Status__c =='On Hold' || p.EI2_Project_Status__c=='FO Hold' ||
            p.EI2_Project_Status__c=='Construction' || p.EI2_Project_Status__c=='Audit' || 
            p.EI2_Project_Status__c=='QAQC' || p.EI2_Project_Status__c=='House Party Scheduled' ||
            p.ARES_Status__c=='Active' || p.ARES_Status__c =='On Hold' || p.ARES_Status__c == 'FO Hold'||
            p.Project_Status__c=='Active'|| p.Project_Status__c=='On Hold' || p.Project_Status__c=='FO Hold' ){
               EPIds.add(p.id); 
        }
     }
         
     for(task ta:trigger.New){
        
           string status = ta.TStatus__c;
           string priority = ta.TPriority__c;
           string program = ta.TProgram_Related_To__c;
           string subj = ta.TSubject__c;
           string comm = ta.TComments__c;
                                    
           if( (ECIds.contains(ta.WhoId) || EPIds.contains(ta.WhatID)) && ta.Status == 'Completed'){ 
              if(status== null){
                ta.TStatus__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Status field to create a new task');
              }
              if(priority == null){
                ta.TPriority__c.adderror('The Contact or ISEIF and EI2 Project  is still Open. Please Fill the Priority field to create a new task');
              } 
              if(program == null){
                ta.TProgram_Related_To__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Program Related To field to create a new task');
              }
              if(subj== null){
                ta.TSubject__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Subject field to create a new task');
              }
              if(comm== null){
                ta.TComments__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Comments field to create a new task');
              }
             if(status!=null&&priority!=null&&program!=null&&subj!=null){
                EI2tsk = new Task();
                EI2tsk.Subject = ta.TSubject__c;
                EI2tsk.Priority = ta.TPriority__c;
                EI2tsk.Program_Related_To__c = ta.TProgram_Related_To__c;
                EI2tsk.ActivityDate = ta.TDue_Date__c; 
                EI2tsk.OwnerId= ta.OwnerId;
                EI2tsk.Status = ta.TStatus__c;
                EI2tsk.Description = ta.TComments__c;
                EI2tsk.WhoId = ta.WhoId;
                EI2tsk.WhatId = ta.WhatId;
                EI2tsk.Interaction_Result__c=ta.TInteraction_Result__c;
                EI2tsk.Interaction_Source__c = ta.TInteraction_Source__c;
                EI2tsk.Interaction_Type__c = ta.TInteraction_Type__c;
                EI2tsk.RecordTypeId=ta.RecordTypeId;

                EI2tskList.add(EI2tsk );                        
                   
              }
           } 
      } 
      
            
      if(EI2tskList.size()>0){
        database.insert(EI2tskList,false);
      }
      TriggerHandler.firstRun = false;
   }
 }


 
Is there a way to have  the Task Record Type of an auto Task be based off of the Subject of the Task rather then the default of the Task creator?

Thanks!
I have a trigger that auto creates a task if a contact is still in open status.  The trigger is working fine for me, but for a standard user it is not.  There isn't code within the trigger that would be preventing this, so I'm not sure why this would be happening? 

Thanks!
I have two custom objects.  I want an auto task to be related to custom object 1 when the action occurs on object 2.  I'm new to writing triggers, any help would be much appreciated!
We have a custom object called ‘Inspection’ and whenever ‘Partial’ checkbox field on the object is true the ‘Inspection_Popup’ vf page will invoke from page layout and popup screen will ask for confirmation to create a new inspection record. This functionality was working before but after enabling ‘clickjack protection’ got URL doesn’t exist error. I followed Salesforce recommended suggestions, then the popup is showing off for only 1 second then going off. But when it meets the above mentioned criteria to invoke vf page if I’m on a inspection record and move to any new tab before the popup shows off, then the popup constantly showing on the inspection record until user clicks any button on it.
 
Hi,

I'm looking to add multiple account lookups onto the event page.  I've been given an error that since an account lookup is already on the page, I'm not able to do this.  I've contacted Salesforce and was given the advice to create a visualforce page.  I haven't created a visualforce page before, and was wondering if anyone has come across this issue before.  Thanks much!

Katie
Hello,
We have the below trigger that is working for me as an admin, but it's not working for other profiles. What the trigger does is it forces the user to always have an open task until the record is completed.

trigger createNextTask on Task (before update) {
     
   Map<Id,string> whatIds = new Map<Id,string>();
   Set<Id> ECIds = new Set<Id>();
   Set<Id> EPIds = new Set<Id>();
   Map<Id,string> whoIds = new Map<Id,string>();
   set<Id> EI2ContactIds = new Set<Id>();
   set<Id> EI2ProjectIds = new Set<Id>();
   List<Task> EI2tskList = new List<Task>();

   Task EI2tsk;
   private Id eidTaskRecordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Outreach').getRecordTypeId();
  
   if(TriggerHandler.firstRun) {
   
     for(task t:trigger.new){
        if(t.RecordTypeId == eidTaskRecordTypeId){
          string whId = t.WhoId;            
          if(whId!= null && whId.startsWith('003')&& !EI2ContactIds.contains(t.WhoId)){
             EI2ContactIds.add(t.WhoId);
           }
           string whaId = t.WhatId;
           // cnte sandbox id for ISEIF and EI2 Projects is a1Z
           // production id for ISEIF and EI2 Projects is a0Y
           if(whaId!= null && whaId.startsWith('a0Y')&& !EI2ProjectIds.contains(t.WhatId)){
              EI2ProjectIds.add(t.WhatId);
           }
        }     
     } 
     
       
     for(contact c :[select Id,EI2_Act_on_Status__c,ARES_Status__c,Real_Time_Status__c from contact where Id IN :EI2ContactIds  ]){
        if( ( c.EI2_Act_on_Status__c =='Interested'|| c.EI2_Act_on_Status__c == 'Referred')||(c.ARES_Status__c == 'Interested'||c.ARES_Status__c =='Referred')
           ||(c.Real_Time_Status__c == 'Interested'|| c.Real_Time_Status__c == 'Referred')){
               ECIds.add(c.id);
        }
     }      
     for(ISEIF_and_EI2_Projects__c p :[select Id, Project_Status__c, ARES_Status__c, EI2_Project_Status__c From ISEIF_and_EI2_Projects__c where Id IN :EI2ProjectIds ]) {
        if( p.EI2_Project_Status__c=='Active' || p.EI2_Project_Status__c =='On Hold' || p.EI2_Project_Status__c=='FO Hold' ||
            p.EI2_Project_Status__c=='Construction' || p.EI2_Project_Status__c=='Audit' || 
            p.EI2_Project_Status__c=='QAQC' || p.EI2_Project_Status__c=='House Party Scheduled' ||
            p.ARES_Status__c=='Active' || p.ARES_Status__c =='On Hold' || p.ARES_Status__c == 'FO Hold'||
            p.Project_Status__c=='Active'|| p.Project_Status__c=='On Hold' || p.Project_Status__c=='FO Hold' ){
               EPIds.add(p.id); 
        }
     }
         
     for(task ta:trigger.New){
        
           string status = ta.TStatus__c;
           string priority = ta.TPriority__c;
           string program = ta.TProgram_Related_To__c;
           string subj = ta.TSubject__c;
           string comm = ta.TComments__c;
                                    
           if( (ECIds.contains(ta.WhoId) || EPIds.contains(ta.WhatID)) && ta.Status == 'Completed'){ 
              if(status== null){
                ta.TStatus__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Status field to create a new task');
              }
              if(priority == null){
                ta.TPriority__c.adderror('The Contact or ISEIF and EI2 Project  is still Open. Please Fill the Priority field to create a new task');
              } 
              if(program == null){
                ta.TProgram_Related_To__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Program Related To field to create a new task');
              }
              if(subj== null){
                ta.TSubject__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Subject field to create a new task');
              }
              if(comm== null){
                ta.TComments__c.adderror('The Contact or ISEIF and EI2 Project is still Open. Please Fill the Comments field to create a new task');
              }
             if(status!=null&&priority!=null&&program!=null&&subj!=null){
                EI2tsk = new Task();
                EI2tsk.Subject = ta.TSubject__c;
                EI2tsk.Priority = ta.TPriority__c;
                EI2tsk.Program_Related_To__c = ta.TProgram_Related_To__c;
                EI2tsk.ActivityDate = ta.TDue_Date__c; 
                EI2tsk.OwnerId= ta.OwnerId;
                EI2tsk.Status = ta.TStatus__c;
                EI2tsk.Description = ta.TComments__c;
                EI2tsk.WhoId = ta.WhoId;
                EI2tsk.WhatId = ta.WhatId;
                EI2tsk.Interaction_Result__c=ta.TInteraction_Result__c;
                EI2tsk.Interaction_Source__c = ta.TInteraction_Source__c;
                EI2tsk.Interaction_Type__c = ta.TInteraction_Type__c;
                EI2tsk.RecordTypeId=ta.RecordTypeId;

                EI2tskList.add(EI2tsk );                        
                   
              }
           } 
      } 
      
            
      if(EI2tskList.size()>0){
        database.insert(EI2tskList,false);
      }
      TriggerHandler.firstRun = false;
   }
 }


 
Is there a way to have  the Task Record Type of an auto Task be based off of the Subject of the Task rather then the default of the Task creator?

Thanks!
I have a trigger that auto creates a task if a contact is still in open status.  The trigger is working fine for me, but for a standard user it is not.  There isn't code within the trigger that would be preventing this, so I'm not sure why this would be happening? 

Thanks!
I have two custom objects.  I want an auto task to be related to custom object 1 when the action occurs on object 2.  I'm new to writing triggers, any help would be much appreciated!