• #63109
    Salesforce | Prachi Prachi #6
    Forcetalks

    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?

     

    #63120
    Salesforce | Nikita Nikita #1
    Forcetalks

    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

CONTACT US

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

Sending

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

or    

Forgot your details?