You need to sign in to do that
Don't have an account?
james12344321
create a basic custom sobject from a custom button
Hi,
I have a basic new sobject as an example called essay__c with one field called name__c.
I'd like to have a custom button on the accounts tab that when pressed creates a new essay record. I'm trying thew following code in the button but it doesn't work:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var t1= new sforce.SObject("essay__c "); t1.name__c = "jim";
var result = sforce.connection.create([t1]);
It's probably something really stupid. Does anyone know why please?
Thanks,
James.
What are you getting in reponse? try to use callback method.
Hi,
The error is:
{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'essay__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.', detail:{InvalidSObjectFault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'essay__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.', row:'-1', column:'-1', }, }, }
Make sure you're using the correct API name for your custom object. That's the first thing to check.
Is your development org having a namespace and is your application a Managed Package?