• Saurabh Thorat
  • NEWBIE
  • 25 Points
  • Member since 2018

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

I'm getting the following error on my VF page apex

Error: Unknown property 'Solution__c' referenced in ProductEnhancements

Please help


This is the code:

<apex:page> standardController="Solution__c" sidebar="false">
<apex:form>
<apex:pageblock title="Product Details" id="ACPPageBlock" mode="edit">
<apex:pagemessages/>
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}"/>                
<apex:commandButton value="Cancel" action="{!cancel}"/>             
</apex:pageBlockButtons>            
<apex:actionRegion >                
<apex:pageBlockSection title="Basic Opportunity Info" columns="1">                     
<apex:inputField value="{!Solution__c.CustomerID__c}"/>                     
<apex:pageBlockSectionItem >                        
<apex:outputLabel value="Product"/>                        
<apex:outputLabel >                            
<apex:inputField value="{!Solution__c.Product__c}">                                 
<apex:actionSupport event="onchange" rerender=" ACPPageBlock" status="Product__c"/>                             
</apex:inputField>                            
<apex:actionStatus startText="applying value..." id="Product__c"/>                          
</apex:outputLabel> 
</apex:pageBlockSectionItem> 
</apex:pageBlockSection>               
</apex:actionRegion>            
<apex:pageBlockSection title="Ratings and Reviews" columns="1" rendered="{!Solution__c.Product__c == 'UGC-R&R'}">                
<apex:inputField value="{!Solution__c.Sorting_Functionality__c}"/>            
</apex:pageBlockSection>            
</apex:pageBlock>
</apex:form>
</apex:page>

 

I'am trying to create an apex trigger for conditional autonumber on lead based on lead record type. Getting an error ''execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0''. Can someone help pelase? Thanks.

trigger Autonumber on Lead (before insert, before update) {

    list<Lead> lead= [SELECT Id,Name,Company,Status,Lead_Number__c FROM Lead WHERE Lead_Number__c !=:null AND Lead_Number__c > 0 order by Lead_Number__c desc limit 1];
    decimal maxlead=lead[0].Lead_Number__c;    

    for(Lead Lead:Trigger.new){
        if(lead.RecordTypeId =='0126F000001Cmgn'){
            lead.Lead_Number__c = Integer.valueOf(maxlead)+1;
        }
    }  
}

I'm getting the following error on my VF page apex

Error: Unknown property 'Solution__c' referenced in ProductEnhancements

Please help


This is the code:

<apex:page> standardController="Solution__c" sidebar="false">
<apex:form>
<apex:pageblock title="Product Details" id="ACPPageBlock" mode="edit">
<apex:pagemessages/>
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}"/>                
<apex:commandButton value="Cancel" action="{!cancel}"/>             
</apex:pageBlockButtons>            
<apex:actionRegion >                
<apex:pageBlockSection title="Basic Opportunity Info" columns="1">                     
<apex:inputField value="{!Solution__c.CustomerID__c}"/>                     
<apex:pageBlockSectionItem >                        
<apex:outputLabel value="Product"/>                        
<apex:outputLabel >                            
<apex:inputField value="{!Solution__c.Product__c}">                                 
<apex:actionSupport event="onchange" rerender=" ACPPageBlock" status="Product__c"/>                             
</apex:inputField>                            
<apex:actionStatus startText="applying value..." id="Product__c"/>                          
</apex:outputLabel> 
</apex:pageBlockSectionItem> 
</apex:pageBlockSection>               
</apex:actionRegion>            
<apex:pageBlockSection title="Ratings and Reviews" columns="1" rendered="{!Solution__c.Product__c == 'UGC-R&R'}">                
<apex:inputField value="{!Solution__c.Sorting_Functionality__c}"/>            
</apex:pageBlockSection>            
</apex:pageBlock>
</apex:form>
</apex:page>

 

I'am trying to create an apex trigger for conditional autonumber on lead based on lead record type. Getting an error ''execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0''. Can someone help pelase? Thanks.

trigger Autonumber on Lead (before insert, before update) {

    list<Lead> lead= [SELECT Id,Name,Company,Status,Lead_Number__c FROM Lead WHERE Lead_Number__c !=:null AND Lead_Number__c > 0 order by Lead_Number__c desc limit 1];
    decimal maxlead=lead[0].Lead_Number__c;    

    for(Lead Lead:Trigger.new){
        if(lead.RecordTypeId =='0126F000001Cmgn'){
            lead.Lead_Number__c = Integer.valueOf(maxlead)+1;
        }
    }  
}