• #30745
    Forcetalks

    What does (!test.isRunningTest()) signifies in Salesforce?

    What does (!test.isRunningTest()) signifies in Salesforce?

     

    #30769
     Prachi #6
    Forcetalks

    Hello Chancal,

    The Test.isRunningTest() method is used to identify, if the piece of code being executed is invoked from a Test class execution or from other artefacts such as a Trigger, Batch Job etc. Returns true if the code being executed is invoked from a test class otherwise returns a false.

    ! is the Logical complement operator. Inverts the value of a Boolean, so that true becomes false, and false becomes true.

    So,  (!test.isRunningTest()) will Return false if the code being executed is invoked from a test class otherwise returns a true.

    Thanks.

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

Please to reply to this topic.

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?