• BrivoSFDC
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
I've had CMSForce installed for quite a few years now. I have a fairly new form that's been created where some users get the following error:

j_id0:j_id1:j_id2:j_id180:j_id181:j_id182:0:j_id184:j_id185:j_id187:j_id193:7:j_id200:j_id201:j_id214: Validation Error: Value is not valid

Anyone have any ideas what the problem might be? Unfortunately, the error doesn't give me a clue as to what could even be wrong with it.

Any help is much appreciated.

Hello all,

 

I'm hoping that I can get some help with this code. I'm trying to write a visualforce page to redirect users to an error page for leads with a specific record type id. I seem to have it working for the System Administrator profile, but not for others. Here's what I have so far:

 

public with sharing class DispatcherLeadViewController {
    
    private ApexPages.StandardController controller = null;
    
    public DispatcherLeadViewController (ApexPages.StandardController controller){
        this.controller = controller;

    }
    
    public PageReference redirectDefaultLead(){
        
        Lead l = [Select id, recordtypeid from Lead where Id = :ApexPages.currentPage().getParameters().get('id')];
        
        if (l.recordtypeid == '012C0000000QAWZ') {
        
        return Page.defaultleadredirect;   
    
        } else {
               return new PageReference ('/' + l.id + '?nooverride=1');
        }
    }
}

 Code for page:

 

<apex:page standardController="Lead" extensions="DispatcherLeadViewController" 
  action="{!redirectDefaultLead}">
</apex:page>

I'm not sure what I'm missing. Any help would be MUCH appreciated.

 

Thanks!!!

Hello all,

 

I'm hoping that I can get some help with this code. I'm trying to write a visualforce page to redirect users to an error page for leads with a specific record type id. I seem to have it working for the System Administrator profile, but not for others. Here's what I have so far:

 

public with sharing class DispatcherLeadViewController {
    
    private ApexPages.StandardController controller = null;
    
    public DispatcherLeadViewController (ApexPages.StandardController controller){
        this.controller = controller;

    }
    
    public PageReference redirectDefaultLead(){
        
        Lead l = [Select id, recordtypeid from Lead where Id = :ApexPages.currentPage().getParameters().get('id')];
        
        if (l.recordtypeid == '012C0000000QAWZ') {
        
        return Page.defaultleadredirect;   
    
        } else {
               return new PageReference ('/' + l.id + '?nooverride=1');
        }
    }
}

 Code for page:

 

<apex:page standardController="Lead" extensions="DispatcherLeadViewController" 
  action="{!redirectDefaultLead}">
</apex:page>

I'm not sure what I'm missing. Any help would be MUCH appreciated.

 

Thanks!!!

I have a couple custom objects related to the lead record.  When I convert the lead, I want these related list to move over to the Account and Opportunity.

 

I found a trigger on the Appexchange that is supposed to do exactly what I need, but it is not working correctly.  It only moves one record from the related list over.  I need the trigger to move all related list records.

 

Below is the trigger I'm using.  How can I modify this to re-parent all of the related records to the account, not just one of them.  I think it may have something to do with the "break;" line of the code, but don't know enough about Apex to know for sure.

 

trigger UpdateCustomeObject_Trigger on Lead (before update) {

for (Integer i = 0; i < Trigger.new.size(); i++){
    if (Trigger.new[i].IsConverted == true && Trigger.old[i].isConverted == false){
    Set<Id> leadIds = new Set<Id>();
    for (Lead lead : Trigger.new) {
        leadIds.add(lead.Id);
    }
   
    Map<Id, CustomObject__c> entries = new Map<Id, CustomObject__c>([select Contact__c, Opportunity__c, Account__c, Lead__c from CustomObject__c where lead__c in :leadIds]);       
    if(!Trigger.new.isEmpty()) {
    for (Lead lead : Trigger.new)  {
    for (CustomObject__c CustomObject : entries.values()) {
    if (CustomObject.Lead__c == lead.Id) {
        CustomObject.contact__c = lead.ConvertedContactId;
        CustomObject.opportunity__c = lead.ConvertedOpportunityId;
        CustomObject.account__c = lead.ConvertedAccountId;
        update CustomObject;
        break;
    }
    }
    }
    }
    }
    }
}