Config.apex

  • Docs
  • Tutorials
Docs Menu
  • Config
  • SObjectHandler
  • CacheStore

SObjectHandler Guide

SObjectHandler

SObjectHandler

SObjectHandler provides easy integrations with SObjects and CustomSettings.

To create a read handler, we can do this:

configService.onRead('/System/CustomButton/list', new Config.SObjectHandler('Custom_Button__c')
    .fetch('SELECT Id, Name FROM Custom_Button__c')
    .then(R.pluck.apply('Name'))
);

To create a write handler, we can do this:

configService.onWrite('/System/CustomButton/new', new Config.SObjectHandler('Custom_Button__c')
    .doInsert(new Map{ ...  });
);

Methods

MethodDescription
SObjectHandler(String)Create an instance with the object type
fetch(String)Get the records from the query
then(Func)Add the Func to process the data
doInsert(Map)Insert the data
doUpdate(Map)Update the records with the data
doDelete()Delete the records

Contribute on Github! Edit this section.