• rao venky
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 1
    Replies
While run a following code i have got error like 
[Error] Error: Mycontroller Compile Error: Illegal assignment from List<Account> to Account at line 6 column 3
Can anybody give a solution ?
CODE:
<apex:page controller="Mycontroller" tabStyle="Account">
<apex:form >
<apex:pageBlock title="Account Details">
<apex:pageBlockSection title="Account information">
    <apex:inputField value="{!Account.Name}"/>
    <apex:inputField value="{!account.Phone}"/>
    <apex:inputField value="{!account.Industry}"/>
    <apex:inputField value="{!account.Website}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Account Details">
    <apex:inputField value="{!Account.Fax}"/>
    <apex:inputField value="{!Account.Shippingcity}"/>
    <apex:inputField value="{!Account.AnnualRevenue}"/>     
</apex:pageBlockSection>
<apex:pageBlockButtons>
 <apex:commandButton action="{!Save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
CLASS:
public with sharing class Mycontroller
{
 Public Account acc;
 Public Mycontroller()
 {
  acc=[SELECT id,Name,Phone,Industry,Website,Fax,Shippingcity,AnnualRevenue from account Where id=:ApexPages.currentpage().getparameters().get('id')];
  }
 Public account getaccount()
 {
  return acc;
  }
 Public Pagereference Save()
 {
 update acc;
 pagereference page=new Apexpages.StandardController(acc).view();
  return Page; 
 }
}
Hai Everyone,

I wirtten sample VFpage code. It shows error "System.LimitException: Maximum stack depth reached: 1001 ".Can any please Explain this One?
    <apex:page controller="AccountWizardController" tabStyle="Account">
  <apex:sectionHeader title="Account Wizard" subtitle="Step 1 of 3"/>
  <apex:form >
    <apex:pageBlock >
     </apex:pageBlock>
  </apex:form>
</apex:page>
Class: public with sharing class AccountWizardController 
{
  Public Account acc{get; set;}
 Public AccountwizardController()
 {
  Account acc=new account();
  }
}
Hai,
 Batch apex code for account filedupdate: Getting below error,can anybody help me?
[Error] Error: Compile Error: Argument type of global method must also be global: List<Account> at line 9 column 17

CODE:
global class Accountupdate implements Database.Batchable<sObject>
{
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query = 'SELECT Id,Name,Phone FROM Account ';
        return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        for (Account a : scope)
        {
           a.Phone='123';
        }
        update a;
    }  
    global void finish(Database.BatchableContext BC)
    {
    }
}
Can any body send SFDC401 Certification Dumps? Please
Thanks advanced
Hai,
Can anybody send the Custom setting Real time scenario?
Hai to all,
My question is Can we make the field is required by the trigger?

if yes please send the code
Create contact on account by writing trigger Please send the code???
We have 3 objects Account, Contact, Opportunity.
   In a VF page, we need to display the names of contact & Opportunity which are related to Account.
 
Hai,
How to write the vf code for SearchButton?
Send the few soql subquery examples???
Hai,
Clear Explain about Eclipse,How we can add the Force.com ide to Eclipse Plz share the Screen shots.....
Advanced thanks
Hello, sorry for the my language
 Can we bypass the trigger logic to particular profile? if yes how?
How to write Javascript for standard pagelayout .could you please tell me the inlinevf page?
how to find profile name of current user in trigger and how to write the test class for that trigger
hello,
Here's the error message I'm getting when trying to save my page:
Error:Error: Unknown property 'String.name'      Can  any one help me
VF code:
<apex:page controller="Accountonclickconlist" sidebar="false" id="pcc">
<apex:form >
  <apex:pageBlock id="pgbl">
   <apex:pageBlockSection title="Accounts" id="pgbs">
     <apex:pageblockTable value="{!Accounts}" var="account" id="pgbtable">
      <apex:column headerValue="account name"/>
       <apex:commandLink value="{!account.name}" reRender="Contactblock">
        <apex:actionSupport event="onclick" action="{!getrelatedcontactlist}" reRender="contactbl">
          <apex:param name="accountid" assignTo="{!accountid}" value="{!account.id}">
          </apex:param>
          </apex:actionsupport>
          </apex:commandlink>   
     </apex:pageblockTable>
   </apex:pageBlockSection> 
  </apex:pageBlock>
    <apex:pageBlock id="contactbl">
     <apex:pageBlockSection title=" Contacts">
      <apex:pageBlockTable value="{!contacts}" var="contact">
        <apex:column headerValue="firstname" value="{!contact.firstname}"/>
        <apex:column headerValue="Lastname" value="{!contact.lastname}"/>  
      </apex:pageBlockTable>
     </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form> 
</apex:page>

Class:
public with sharing class Accountonclickconlist 
{
 public list<account>accountlist{set;get;}
 public list<contact>contactlist{set;get;}
 public id accountid{set;get;}
   public Accountonclickconlist()
   {
    accountlist=new list<account>();
    contactlist=new list<contact>();
     accountlist=[select id,name from account limit 50];
     }
    public void getrelatedcontactlist()
    {
       contactlist=[select id, Lastname, Firstname from contact WHERE Accountid=:Accountid limit 50];
       }

}

 
Hai,
 What is the diffrence between Abstract and interface classes with examples?
Hello to all,


What are the type of Approval Process Briefly???
 Help me, Thanks advanced
Hai,
 Batch apex code for account filedupdate: Getting below error,can anybody help me?
[Error] Error: Compile Error: Argument type of global method must also be global: List<Account> at line 9 column 17

CODE:
global class Accountupdate implements Database.Batchable<sObject>
{
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query = 'SELECT Id,Name,Phone FROM Account ';
        return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        for (Account a : scope)
        {
           a.Phone='123';
        }
        update a;
    }  
    global void finish(Database.BatchableContext BC)
    {
    }
}
how to find profile name of current user in trigger and how to write the test class for that trigger