• #63109
    Salesforce | Prachi Prachi #6

    How Will the Default value be applied to a new record created by apex in Salesforce?

    There is a custom Object named “Training__c” which has field “Trainer__c”. I have set some default value in that field. I want to know if that default value will be applied to new record created by apex code , if yes than please explain me how?


    Salesforce | Nikita Nikita #1

    Hi Prachi,

    If the Default value of the field is not getting populated by Apex then we have to use “Dynamic Apex”. Create instance of object from sObjectType like shown below:


Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

Popular Salesforce Blogs


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?