You need to sign in to do that
Don't have an account?
Sandy singh
Error:"Account Name: Account: bad field names on insert/update call: Name"
Hi ,
I am getting Error:"Account Name: Account: bad field names on insert/update call: Name" once trying to update Account object from apex Controller.
Apex Code:
public class sampleController{
public Account acc = new Account();
public PageReference save(){
acc.PersonMailingStreet = 'bangalore';
acc.PersonMailingCity = 'abc';
update acc ;
return null;
}
}
can anyone help me on this.
Thanks in advance,
Sandy
Hi,
In Order to update you need to create the refrence of Account by giving the ID for that account. Then after that do the updation
Account acc = new Account(id='0019000000AGHT7');
acc.AccountNumber='1234';
update acc ;
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
What Navatar says is true.
If the code is in a controller , you can get the account id:
You can reference this Id, to update the account details.
Hope this helps
regards
SF Partner