Skip to content

Abstract Domain / DML Logic #337

Answered by wimvelzeboer
reignman5 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @reignman5,

I think I would solve your first question something like this:

public with sharing class AccountTriggerHandler extends fflib_SObjectDomain 
{
   ...
  public override void onAfterUpdate(Map<Id, SObject> existingRecords)
  {
    onPartnerAccountsRecalculateCurrencyFields();
    onClientAccountsRecalculateCurrencyFields(); 
   }

   private void onPartnerAccountsRecalculateCurrencyFields()
   {
      // Here you can see that there is a domain named "Accounts"
      // with a filter method "selectByRecordType" returning a new domain 
      // with just only records of the desired recordtype. 
      IAccounts partnerAccounts = Accounts.newInstance(Records).selectByRecordType('P…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@reignman5
Comment options

@wimvelzeboer
Comment options

@reignman5
Comment options

@wimvelzeboer
Comment options

@reignman5
Comment options

Answer selected by reignman5
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants