Coder Social home page Coder Social logo

triggerx's People

Contributors

jamesmelville avatar se6wagner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

triggerx's Issues

"after undelete" triggers raise "Attempt to de-reference a null object" exception

I've implemented a concrete class that extends TriggerX. This class has an override of the "onAfterUndelete". What I'm trying to do is use this to block undeletion of a particular object type by iterating over the TriggerX records collection and calling "addError" on the objects in the collection to block the undelete. I wrote a unit test to cover this code, but it fails consistently with "Attempt to de-reference a null object". I debugged the problem and it appears to be a bug in the TriggerX.handleTrigger method. On line 120, you are passing "triggerOldMap.values()" to the handler.doConstruct method for "after undelete" events. It's unclear from the Apex documentation, but as far as I can tell, Trigger.oldMap is not available in "after undelete" trigger context. You should be passing triggerNew to the doContruct method for "after undelete" trigger events. I made this change in my local copy of TriggerX and it worked.

Nice work, by the way!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.