• Reddy
  • NEWBIE
  • 60 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 16
    Replies
User-added image

public class AccountInformation {

    public AccountInformation(HelpEXample controller) {

    }

    public string name{set;get;}
    public string industry{set;get;}
    public string AccountNumber{set;get;}
    public string selectedCountry{set;get;}
    public Account acc {get;set;}

    public AccountInformation()
    {
        acc = new Account();
    }
    public list<selectoption> getCountrysOptions(){
       list<selectOption> so=new list<selectOption>();
       so.add(new selectOption('','-none'));
       so.add(new selectOption('INDIA','india'));
       so.add(new selectOPtion('USA','usa'));
       so.add(new selectOPtion('UK','uk'));
       return so;
       }
       
    
    public PageReference Save()
    {
        insert acc ;
        return new PageReference('/'+acc.id);
    }
}


<apex:page Controller="AccountInformation"  tabStyle="Account" >
<apex:form >
    <apex:pageblock title="Account Details" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="save"/>
            <!--
            <apex:commandButton action="{!new}" value="new" />
            <apex:commandButton action="{!delete}" value="delete"  />    
            -->
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="My Data section" columns="2">
               <apex:inputField value="{!acc.name}"/>
               <apex:inputField value="{!acc.accountNumber}"/>
              <apex:inputField value="{!acc.industry}" />
              <apex:outputLabel value="Enter country"/>
              <apex:selectlist value="{!selectedCountry }"  size="1">
              <apex:selectoption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
              <apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
              <apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
              <Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
              </apex:selectlist>
        </apex:pageBlockSection>
    </apex:pageblock>
</apex:form>
</apex:page>
  • December 17, 2016
  • Like
  • 0
  • December 14, 2016
  • Like
  • 0
Unknown method 'AccountInformation.save()'----- vf page;

<apex:page Controller="AccountInformation"  tabStyle="Account" >
    <apex:form>
        <apex:pageblock title="Account Details" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="save"/>
                <apex:commandButton action="{!new}" value="new" />
                <apex:commandButton action="{!delete}" value="delete"  />    
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="My Data section" columns="2">
                Name:<apex:inputField value="{!account.name}"/>
                AccountNumber:<apex:inputField value="{!account.account number}"/>
                Industry:<apex:inputField value="{!account.industry}" />
            </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>
==============================

unexpected token: 'list'  --- ( error message)

public class AccountInformation {
    public string name{set;get;}
    public string industry{set;get;}
    public integer AccountNumber{set;get;}
    public accountInformation data
    {
        list<account> acc = new list<Account>();
            Account a= new Account();    
            a.name='narendar';
            a.industry='energy';
            a.Account Number=1412001;
            insert a;
        system.debug('list of value:' +acc);
    }
  • December 13, 2016
  • Like
  • 0
 List<Account> la = [SELECT Id,Industry,Name,Rating FROM Account LIMIT 10];
if(la.size() > 0)
{
    system.debug('Records Count….: '+ la.size());
        for(Account acc: la )
    {
        system.debug(acc.id + ' —> ' + acc.Name + ' —> '+ acc.Rating + ' —> '+ acc.Industry);
    }
}
 
this is the error 
Illegal assignment from List&lt;Account&gt; to List&lt;Account&gt;
  • December 13, 2016
  • Like
  • 0
what is the merge statement in DML 
 
  • December 01, 2016
  • Like
  • 0
public class AccountInsert{
    public string accName{get;set;}
    public string accindustry{get;set;}
    public pagereference create(){
    
    list<Account> acc =[select id, name, industry from Account where name=:accname ];
    if(acc.size()>0){
    apexpages.message msg=new Apexpages.Message(apexpages.Severity.Error, 'duplicate records Exit');
    apexpages.addMessage(msg);
    return null;
    }
    else{
    account a=new Account();
    a.name='accname';
    a.industry='accIndustry';    
    insert a;
    }
 pagereference p=new pagereference('/'+ acc.id);
 return p;
   }
}
  • November 30, 2016
  • Like
  • 0
Unknown property 'String.lastname'.
how to using this pgination
  • November 16, 2016
  • Like
  • 0
User-added image

public class AccountInformation {

    public AccountInformation(HelpEXample controller) {

    }

    public string name{set;get;}
    public string industry{set;get;}
    public string AccountNumber{set;get;}
    public string selectedCountry{set;get;}
    public Account acc {get;set;}

    public AccountInformation()
    {
        acc = new Account();
    }
    public list<selectoption> getCountrysOptions(){
       list<selectOption> so=new list<selectOption>();
       so.add(new selectOption('','-none'));
       so.add(new selectOption('INDIA','india'));
       so.add(new selectOPtion('USA','usa'));
       so.add(new selectOPtion('UK','uk'));
       return so;
       }
       
    
    public PageReference Save()
    {
        insert acc ;
        return new PageReference('/'+acc.id);
    }
}


<apex:page Controller="AccountInformation"  tabStyle="Account" >
<apex:form >
    <apex:pageblock title="Account Details" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="save"/>
            <!--
            <apex:commandButton action="{!new}" value="new" />
            <apex:commandButton action="{!delete}" value="delete"  />    
            -->
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="My Data section" columns="2">
               <apex:inputField value="{!acc.name}"/>
               <apex:inputField value="{!acc.accountNumber}"/>
              <apex:inputField value="{!acc.industry}" />
              <apex:outputLabel value="Enter country"/>
              <apex:selectlist value="{!selectedCountry }"  size="1">
              <apex:selectoption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
              <apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
              <apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
              <Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
              </apex:selectlist>
        </apex:pageBlockSection>
    </apex:pageblock>
</apex:form>
</apex:page>
  • December 17, 2016
  • Like
  • 0
  • December 14, 2016
  • Like
  • 0
Unknown method 'AccountInformation.save()'----- vf page;

<apex:page Controller="AccountInformation"  tabStyle="Account" >
    <apex:form>
        <apex:pageblock title="Account Details" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="save"/>
                <apex:commandButton action="{!new}" value="new" />
                <apex:commandButton action="{!delete}" value="delete"  />    
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="My Data section" columns="2">
                Name:<apex:inputField value="{!account.name}"/>
                AccountNumber:<apex:inputField value="{!account.account number}"/>
                Industry:<apex:inputField value="{!account.industry}" />
            </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>
==============================

unexpected token: 'list'  --- ( error message)

public class AccountInformation {
    public string name{set;get;}
    public string industry{set;get;}
    public integer AccountNumber{set;get;}
    public accountInformation data
    {
        list<account> acc = new list<Account>();
            Account a= new Account();    
            a.name='narendar';
            a.industry='energy';
            a.Account Number=1412001;
            insert a;
        system.debug('list of value:' +acc);
    }
  • December 13, 2016
  • Like
  • 0
 List<Account> la = [SELECT Id,Industry,Name,Rating FROM Account LIMIT 10];
if(la.size() > 0)
{
    system.debug('Records Count….: '+ la.size());
        for(Account acc: la )
    {
        system.debug(acc.id + ' —> ' + acc.Name + ' —> '+ acc.Rating + ' —> '+ acc.Industry);
    }
}
 
this is the error 
Illegal assignment from List&lt;Account&gt; to List&lt;Account&gt;
  • December 13, 2016
  • Like
  • 0
public class AccountInsert{
    public string accName{get;set;}
    public string accindustry{get;set;}
    public pagereference create(){
    
    list<Account> acc =[select id, name, industry from Account where name=:accname ];
    if(acc.size()>0){
    apexpages.message msg=new Apexpages.Message(apexpages.Severity.Error, 'duplicate records Exit');
    apexpages.addMessage(msg);
    return null;
    }
    else{
    account a=new Account();
    a.name='accname';
    a.industry='accIndustry';    
    insert a;
    }
 pagereference p=new pagereference('/'+ acc.id);
 return p;
   }
}
  • November 30, 2016
  • Like
  • 0
When I am execute this Trigger I am getting an error at line Query Illegal assignment from LIST<Account> to LIST<Account> at line in Salesforce Trigger


trigger ContactsOnAccount on Contact (after insert, after delete) {
    Set<Id> aId = new Set<Id>();
   
    if(Trigger.isInsert){
        for(Contact opp : Trigger.New){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Count_id__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
       
        for(Account a : acc){
            a.Count_id__c=con.size();
           
        }update acc;
    }
   
    if(Trigger.isDelete){
        for(Contact opp : Trigger.old){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Count_id__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
       
        for(Account a : acc){
            a.Count_id__c=con.size();
           
        }update acc;
    }
 
}