You need to sign in to do that
Don't have an account?
Manjusrinu
inserting records by using list
Hi,
I need to insert a record into account object by using lists.
I tried the following code but it is not working
Can anyone help me to solve out the problem ?
Apex-class:
public class Listaccounts
{
public static void accounts()
{
List<Account> myList = new List<Account>();
Account a = new Account(Name='ramana');
myList.add(a);
}
}
Vf-page:
<apex:page Controller=" Listaccounts ">
</apex:page>
I need to insert a record into account object by using lists.
I tried the following code but it is not working
Can anyone help me to solve out the problem ?
Apex-class:
public class Listaccounts
{
public static void accounts()
{
List<Account> myList = new List<Account>();
Account a = new Account(Name='ramana');
myList.add(a);
}
}
Vf-page:
<apex:page Controller=" Listaccounts ">
</apex:page>
Greetings!
You need to define the inputFied on the Visualforce page to enter the value by the user.Please find the sample code in the below thread:
https://developer.salesforce.com/forums/?id=906F000000094u8IAA
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri