+ Start a Discussion
prashant1985prashant1985 

Insert in custom object

i have created custom object  "scheduletest__c"  when i going to insert into that object its give error

 

Compile Error: unexpected token: '=' at line

 

below is code

 

scheduletest__c asd = new scheduletest__c();
       asd.schedulename__c = 'aaaaaaa';
       insert asd;

 

Thanks

Prashant

Nazeer AhamedNazeer Ahamed

You are populating only one field which is custom field, any mandatory field is there?

prashant1985prashant1985
thanks for reply. i got the solution.
i need to write this code in function.