0

I'm going through some old APEX classes implemented by a fellow developer who has already left the company and having some difficulties to understand in a trigger helper class where trigger is not firing and always return false. Below is the helper class, Trigger Helper calss

updateClaimInventoryFromStaging is the method name that contain the main logic. Can somebody explain me what is the purpose of this statement this.isEnabled('updateClaimInventoryFromStaging') and why it is returning false when updating the record?

Log Statement

Thanks...!

Regards, Sudheera

1
  • 2
    this simply means access the symbol in the current instance of this class. In this case, it's calling a method called isEnabled located in the ClaimModuleStagingTriggerHandler class. To figure out what's going wrong, you need to look at the isEnabled method. Odds are, it's based on a Custom Setting or Custom Metadata, but it really could be anything the developer chose to do. The method name inside quotes is just a plain string, nothing more.
    – sfdcfox
    Nov 12, 2018 at 3:06

1 Answer 1

1

Can somebody explain me what is the purpose of this statement this.isEnabled('updateClaimInventoryFromStaging')

You have an instance method in your class which is declared something as:

private Boolean isEnabled(String args) {
    ...
}

and is being called in the execution flow of the class where updateClaimInventoryFromStaging is the value being passed to args.

and why it is returning false when updating the record?

You need to look into the implementation details of that method as why it is returning false.

2
  • Thanks @sfdcfox and Jayant for your valuable answers. This isEnabled() method is written in another class which is extended by ClaimModuleStagingTriggerHandler class. Unfortunately it is a managed class, so I don't have ability to see the logic inside the isEnabled method. So my struggle continues.
    – Sudh
    Nov 13, 2018 at 8:01
  • Unfortunately, without looking at the code, there's no way to say what's going around. And this is a guess, but possibly there's some custom setting/label where the names of the methods are stored and that the isEnabled() method most likely verifies if the name of the method being passed as an argument exists in there or not. You may like to take a look in that direction.
    – Jayant Das
    Nov 13, 2018 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .