function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Which fields are auto-filled when calling new sforce.SObject()?

Let say I am in an s-control, i have a line (Javascript) something like below:

var task = new sforce.SObject("Task");

When I get the task, which fields are auto-filled? (and filled with what values?)

If there a documentation on default values returned by sforce.SObject() for each object type, e.g. Account, Opportunity, Task, etc?

When you make the new sforce.SObject() call, fields which have defaults are "auto-filled".
For example, go to Setup > App Setup > Customize > Activities > Task Fields.
Go into a picklist field, and you'll see a Default checkbox.
The same applies to other objects (Accounts, Opportunities, etc.).