You need to sign in to do that
Don't have an account?
Surjendu
Field is not writeable for custom objects
I have created a custom object(ExtranetSF) using the standard flow( Go to objects-->Create an object-->Create fields and page layout and stuff)
Then I am trying to access that custom object from my visualforce controller. The following piece of code gives me error.It says that "Field is not writeable".
My question is how do i get past this problem??? Any help
ExtranetSF__c co = new ExtranetSF__c();
co.Name = data.getNonUniqueName();
co.Extranet_Name = data.getDomainName();
co.URL=data.getUrl();
insert co;
Then I am trying to access that custom object from my visualforce controller. The following piece of code gives me error.It says that "Field is not writeable".
My question is how do i get past this problem??? Any help
ExtranetSF__c co = new ExtranetSF__c();
co.Name = data.getNonUniqueName();
co.Extranet_Name = data.getDomainName();
co.URL=data.getUrl();
insert co;
so
co.url__c
or
co.Extranet_Name__c = data.getDomainName();
however you do not report which field is causing the problem, so it is not possible to give more specific help.
so
url_c <> url__c
look into your WSDL to see these API names,
try this link (if you are on NA1, otherwise adjust the url as needed)
https://na1.salesforce.com/soap/wsdl.jsp?type=*
List<Lead> leads = new List<Lead>();
Lead leadA = new Lead(); // create first lead object
leadA.name = 'Test Lead A'; // populate required fields
leadA.company = 'Acme, Inc.'; // populate required fields
leadA.status = 'Open'; // populate required fields
leadA.email = 'jonsmith@abc.com'; // populate email field
leads.add( leadA ); // add Lead A to list
Lead leadB = new Lead(); // create second lead object
leadB.name = 'Test Lead B'; // populate required fields
leadB.company = 'XYZ Corp.'; // populate required fields
leadB.status = 'Open'; // populate required fields
// leave email field null for Lead B
leadB.new_email__c = 'bobjones@gmail.com'; // populate new_email__c since email is null
leads.add( leadB ); // add Lead B to list
UpdateNullEmail.addUpdateNullEmail( leads ); // call your method
} //End of method
Message Edited by jvolkov on 06-17-2008 09:55 AM
Message Edited by jvolkov on 06-17-2008 09:55 AM
Try to write to the FirstName and LastName fields instead of the combined Name field.
I have a similar problem. I'm trying to create a button that uses the record ID of a "current record". The record is in a custom object "Person". When I try to assign a value from a record to a variable, I get an error.
For simplicity, I'm trying to just print the Owner field in this example:
{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
var PersonOwner = '{!Person.Owner__c}';
alert(PersonOwner+" is the owner!");
The error message I get when trying to save is:
What am I doing wrong? Thank you!