I've already set a default value for the field name
with testUser
However, when I tried to create an object from Account.
The object still not coming with the default value on the name field.
Any possible to do so?
Because I'm creating a Web API (non-restful) and pass a new object with default values to the front-end.
How could I get it?
Why doesn't Salesforce provide with such an essential function?
Account acc = new Account();
System.Debug(LoggingLevel.DEBUG, JSON.serializePretty(
acc
));
Expected output
10:57:50.27 (29577741)|USER_DEBUG|[3]|DEBUG|{
"attributes" : {
"type" : "Account"
},
"Name" : "testUser"
}
Actual output
10:57:50.27 (29577741)|USER_DEBUG|[3]|DEBUG|{
"attributes" : {
"type" : "Account"
},
}