• Tristan Jones
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies

Hi, 

I've got a page layout with a visualforce page embedded in it. If I view the page I can see the visualforce page rendered fine, if I use admin rights to 'login as user' I can see the page rendered fine in other people's accounts. The issue is that when users view the page on from their own accounts the visualforce doesn't render, but instead leaves a black X in the top left hand corner of the visualforce section. The rest of the page layout is displayed normally.  

I've given them access to the visualforce pages and I can't work out what's causing the visualforce component to render fine on my account but not on theirs. 

Any ideas? 

Best regards, 
 
Tristan 
Hi all, 

I have apex trigger (pasted below) to assign a lead to a user if the company given is the same as an account. The problem I'm having is that lots of leads coming through our website, seminars, trade shows etc only have approximate account names which do not get assigned through my trigger.

For example if Joe Bloggs is the account owner for Acme Compnay. LTD and a lead is pushed into Salesforce with the Acme Company. LTD  the lead gets allocated to Joe, however if the company on the lead is only Acme, then it doesn't get allocated. 

What I'd like to do is a bit like the range_lookup on the end of Vlookup formulae in Excel, where you can specify if it needs to be an exact or approximate match. Is there anyway to do this in my trigger? 

Many thanks, 

Tristan 


trigger addAccount on Lead (before Insert, before Update){

List<string> companies=new list<string>();

For (lead l:trigger.new){
  companies.add(l.company);
}


List<Account> leadAccountIds=[Select Id, OwnerId, Name FROM Account WHERE Name IN: companies];

Map<String, Id> acctNameId=new Map<String, Id>();
Map<String, Id> acctNameOwner=new Map<String, Id>();
 
For (Account a:leadAccountIds){
  acctNameId.put(a.name,a.Id);
  acctNameOwner.put(a.name,a.ownerId);
}


For (Lead l2:trigger.new){
  if(acctNameId.containsKey(l2.company)){
    l2.Account__c=acctNameId.get(l2.company);
    l2.ownerId=acctNameOwner.get(l2.company);
  }
}
}
 
Hi, 

I'm trying to have the subject field of a task that is triggered in a custom object using an Apex trigger populate with the the name of the opportunity the object is related to. I can get the unique ID to show  when i reference the lookup field in the custom object ('opportunity__c') but when I use 'object__r.name' it comes up blank. Does anyone know what could be causing this? My trigger code is:

trigger TaskAllocation on Action__c (after insert) {    
    List<Task> taskList = new List <Task>();
    for (Action__c a:Trigger.New)
        
    {
      
    {
    Task t = new Task();
    
        t.OwnerID = a.Action_owner__c;
        t.WhatId = a.Id;
        t.Subject =  a.opportunity__r.Name;
        t.description = a.action__c;
        t.Status = 'Not Started';
        t.ActivityDate = a.deadline__c;
        t.priority = 'Normal';
    taskList.add(t);
    }
    
    }
    if(taskList.size()>0)
    insert taskList;
   
    
}


Cheers, 

Tristan

Hi Guys, 

I'm putting in a workflow to calculate pipeline stage based on what opportunity fields have been completed by the user. An aspect of this is that a user has to identify and document various decision makers at different stages (coach, technical buyer etc). I've been using a text field that the user has to write the name in as part of the workflow with no problem.

Now I'd like to change this text field to a lookup field and have the user have to select the decision makers from their existing contacts instead of write a name in a text box. I've set this up in the opportunity using lookup fields but I'm not able to find these lookup fields in the rule criteria fields in workflow rules and as such can't link them to pipeline stage. Does anyone know of any way around this? 

 

Thanks 

Hi, 

I'm trying to have the subject field of a task that is triggered in a custom object using an Apex trigger populate with the the name of the opportunity the object is related to. I can get the unique ID to show  when i reference the lookup field in the custom object ('opportunity__c') but when I use 'object__r.name' it comes up blank. Does anyone know what could be causing this? My trigger code is:

trigger TaskAllocation on Action__c (after insert) {    
    List<Task> taskList = new List <Task>();
    for (Action__c a:Trigger.New)
        
    {
      
    {
    Task t = new Task();
    
        t.OwnerID = a.Action_owner__c;
        t.WhatId = a.Id;
        t.Subject =  a.opportunity__r.Name;
        t.description = a.action__c;
        t.Status = 'Not Started';
        t.ActivityDate = a.deadline__c;
        t.priority = 'Normal';
    taskList.add(t);
    }
    
    }
    if(taskList.size()>0)
    insert taskList;
   
    
}


Cheers, 

Tristan

Hi, 

I've got a page layout with a visualforce page embedded in it. If I view the page I can see the visualforce page rendered fine, if I use admin rights to 'login as user' I can see the page rendered fine in other people's accounts. The issue is that when users view the page on from their own accounts the visualforce doesn't render, but instead leaves a black X in the top left hand corner of the visualforce section. The rest of the page layout is displayed normally.  

I've given them access to the visualforce pages and I can't work out what's causing the visualforce component to render fine on my account but not on theirs. 

Any ideas? 

Best regards, 
 
Tristan 
Hi, 

I'm trying to have the subject field of a task that is triggered in a custom object using an Apex trigger populate with the the name of the opportunity the object is related to. I can get the unique ID to show  when i reference the lookup field in the custom object ('opportunity__c') but when I use 'object__r.name' it comes up blank. Does anyone know what could be causing this? My trigger code is:

trigger TaskAllocation on Action__c (after insert) {    
    List<Task> taskList = new List <Task>();
    for (Action__c a:Trigger.New)
        
    {
      
    {
    Task t = new Task();
    
        t.OwnerID = a.Action_owner__c;
        t.WhatId = a.Id;
        t.Subject =  a.opportunity__r.Name;
        t.description = a.action__c;
        t.Status = 'Not Started';
        t.ActivityDate = a.deadline__c;
        t.priority = 'Normal';
    taskList.add(t);
    }
    
    }
    if(taskList.size()>0)
    insert taskList;
   
    
}


Cheers, 

Tristan