Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void processSync( String listNewJSON, String recordTypesJSON, boolean isUpdate ) {
- if ( listNewJSON != null ) {
- List<Contact> triggerNew = (List<Contact>)JSON.deserialize( listNewJSON, List<Contact>.class );
- Map<String,Id> recordTypesMap = (Map<String,Id>)JSON.deserialize( recordTypesJSON, Map<String,Id>.class ); //a map, e.g., {AccountStudentRecord": "012a0000001ZMUzAAO"}
- List<Id> contactRecordTypeIds = new List<Id>();
- for ( String recordTypeReference : recordTypesMap.keySet() ) {
- if ( recordTypeReference.startsWith('Contact') ) {
- contactRecordTypeIds.add( recordTypesMap.get(recordTypeReference) );
- }
- }
- List<StudentSearchHash__c> newHashes = new List<StudentSearchHash__c>();
- List<StudentSearchHash__c> hashesForUpdate = new List<StudentSearchHash__c>();
- for ( Contact thisContact: [Complicated nested SOQL IN :triggerNew]) {
- //If I add here SOQL still runs recursivly, but logic executes one time. If!TriggerMonitor.ExecutedTriggerMethods.contains('updateSyncTrigger'+String.valueof(thiscontact.id)); {TriggerMonitor.ExecutedTriggerMethods.add('updateSyncTrigger'+String.valueof(thiscontact.id));
- // do stuff
- }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement