New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Saturday, 10 November 2012

Apex Data Loader errors

1. Insert failed: inactive user
Ans. If you are trying to insert record for inactive user then this error come.

2. Entity deleted
Ans. If you are trying to insert any lookup filed of deleted record this error will come

3. Time Zone mismatch (unexpected result occur)
Ans. you should set the settings of data loader ( time zone filed) according to your sandbox or production environment. Otherwise it will compare with the previous day value of the current date day value.

Wednesday, 17 October 2012

maximum trigger depth exceeded MyObject__c trigger

* The above error is mainly because of the recursive execution of the trigger after update again and again.
* To control the recursive trigger, use if condition or any other controllable steps to avoid the recursion.
Refer:
http://boards.developerforce.com/t5/Apex-Code-Development/Classic-Error-maximum-trigger-depth-exceeded-Opportunity-trigger/td-p/209817

Friday, 17 August 2012

How to disply custom client-side error messages on VF pge

Custom Error Messages on VF page

How to dipaly client side error messages like above?
Solution:
 By using jquery you can diplay error messages as you mentioned in the above image
1. First download the jquery file here.
2. If it is not downloading copy the code and paste it in notepad and save it with jquery.js like that.
3. Then upload that file into static resources.
4. In your vf page use the following code
<apex:page standardcontroller="Account" showHeader="false" standardStylesheets="false">
    
    <apex:includeScript value="{!$Resource.jquery}"/>
    <apex:includeScript value="http://ajax.microsoft.com/ajax/jquery.validate/1.6/jquery.validate.min.js"/>
    
    <script type="text/javascript"> 
        $(document).ready(function() {
             
            $('[id$=commentForm]').validate();             
             
            $('[id$=name]').rules("add",{
                required: true,
                minlength: 5
            });     
            
            $('[id$=email]').rules("add",{
                required: true,
                email: true
            });      
            
            $('[id$=url]').rules("add",{
                url: true
            });
            
            $('[id$=comment]').rules("add",{
                required: true
            });
            
            $('[id$=pwd]').rules("add",{
                required: true,
                minlength: 5
            });
            
            $('[id$=cpwd]').rules("add",{
                required: true,
                minlength: 5,
                equalTo: '[id$=pwd]'
            });      
            
            /* Customised the messages */
            jQuery.validator.messages.required = "You better have entered a value.. or else!"; 
            jQuery.validator.messages.equalTo = "No silly, you're supposed to type the same set of characters AGAIN.";                                                
        });
        
    </script>   
    
    <!-- Ignore my template -->
    <apex:composition template="Template">
        <apex:define name="title">
            <a href="http://thesilverlining-developer-edition.na7.force.com/jqueryvalidatedemo/">jQuery Forms Validation Demo</a>
        </apex:define>
        
        <apex:define name="blurb">
            <p>
                Fiddle with the form entering combinations of correct and incorrect values to see the validation rules in action. Hitting the sumbit button will also trigger form checking.
            </p>
        </apex:define>


        <apex:define name="content">    
            <apex:outputPanel layout="block" style="text-align:center; font-size:12px;padding: 4px">
                <apex:form id="commentForm" > 

                        <apex:outputlabel for="name">Name <span class="star">*</span></apex:outputlabel> 
                        <apex:inputtext id="name" value="{!account.name}"/>
                        <br/>
                        <apex:outputlabel for="email">E-Mail <span class="star">*</span></apex:outputlabel> 
                        <apex:inputtext id="email"  value="{!account.name}"/> 
                        <br/>
                        <apex:outputlabel for="url">URL (optional)</apex:outputlabel> 
                        <apex:inputtext id="url"  value="{!account.name}" /> 
                        <br/>
                        <apex:outputlabel for="comment">Your comment <span class="star">*</span></apex:outputlabel> 
                        <apex:inputtextarea id="comment" value="{!account.name}" style="width: 30%"/>
                        <br/>
                        <apex:outputLabel for="pwd">Password <span class="star">*</span></apex:outputLabel>
                        <apex:inputSecret id="pwd" value="{!account.name}"/>
                        <br/>
                        <apex:outputLabel for="cpwd">Confirm Password <span class="star">*</span></apex:outputLabel>
                        <apex:inputSecret id="cpwd" value="{!account.name}"/>                        
                        <br/>
                        <input type="submit" />
            
                </apex:form>
            
            </apex:outputPanel>
            
        </apex:define>
        
    </apex:composition>
     
</apex:page>
5. make changes according to your vfpage.
6. Then you will get the desired output
Refer Here:
 http://th3silverlining.com/2010/03/02/visualforce-form-validation-enhanced/#more-543

Saturday, 11 August 2012

How to show visual force error?

<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Student Info">
<apex:inputField value="{!Account.Name}"/>
<apex:inputField value="{!Account.AccountNumber}" required="True"/>
<apex:inputField value="{!Account.AnnualRevenue}" required="True"/>
<apex:inputField value="{!Account.Description}" required="True"/>
<apex:inputField value="{!Account.Site}" required="True"/>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>

Illegal assignment from LIST to LIST

* If there is any apex class with the same name of the standard or global sObjects while creating List, map,set the above error will reflect.
*We can solve this problem in two ways:
1. We have to rename our Apex Class to some other name.
2. Use 'Schema' before sObject while creating List, Set, Map (Don't use 'schema' before sObject in SOQL Query)
- List<Schema.Account> aclist = new List<Schema.Account>();
- return type should be also like List<Schema.Account>
-Click here to see the example here!

Refer:
 Illegal assignment from LIST<Account> to LIST<Account>

Labels