• 1Installation
  • 2Preliminary Knowledge
  • 3Create Triggers
  • 4Trigger Handler
  • 5Bulk Object
  • 6Find Specific Objects
  • 7Data Sharing
  • 8Catch All Events
  • 9Trigger Controller
  • 10Normal Trigger Event Handler
  • 11Trigger Context
  • 12Unit Test
  • 13Take Only Trigger Execution

Trap.apex

  • Docs
  • Tutorials
Getting started with Trap.apex

Bulk Object

A bulk object represents a trunk of SObjects to be processed in the trigger. Bulk objects define the scope that you can work on the data. By default, they provide data as encapsulated streams, newStream for new SObjects and oldStream for old SObjects.

bulkObj.oldStream
    .tap(R.debug.apply('Old objects: '))
    .subscribe(new CustomFunc());

You can access to the old/new SObject if you are already in one stream.

bulkObj.newStream
    .filter((Func)R.pipe.run(
        Trap.F.getOld,
        new CustomFilterFunc()
    ))
    .subscribe(new CustomFunc());
Done