I. Trigger.isBefore and Trigger.isInsert
1. Update Archived_Alternate_Name_ID__c field of Background_Search__c object:
Logic:
- Alternate_Name__c should not be equal to null.
- Archived_Alternate_Name_ID__c should be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Alternate_Names__c object and fetch the value of Name field based on Alternate_Name__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in lstAlternetName list of Alternate_Names__c object.
- Set the value of Archived_Alternate_Name_ID__c field of Background_Search__c object from Name field of Alternate_Names__c object, if the size of lstAlternetName list is greater than zero.
2. Update Archived_Additional_Address_ID__c field of Background_Search__c object:
Logic:
- Additional_Address__c should not be equal to null.
- Archived_Additional_Address_ID__c should be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Additional_Address__c object and fetch the value of Name field based on Additional_Address__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in lstAdditionalAddress list of Additional_Address__c object.
- Set the value of Archived_Additional_Address_ID__c field of Background_Search__c object from Name field of Additional_Address__c object, if the size of lstAdditionalAddress list is greater than zero.
3. Update Background Check Case record:
Logic:
- PreEmploy_Case__c should not be equal to null.
- Search_Complete__c should be false.
If above condition are matched then script fetch and update following fields:
Query:
- Query on PreEmploy_Case__c object and fetch the value of Report_Case_Closed__c field based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in oPreEmployCase object variable of PreEmploy_Case__c object.
- Call "UpdateCaseRecordType" method of "BackgroundSearchTriggercl" class and pass value of PreEmploy_Case__c field of Background_Search__c object as a parameter, if oPreEmployCase variable is not null and the value of oPreEmployCase.Report_Case_Closed__c is true.
- Assign the value of oPreEmployCase.Subject_of_background__c to Subject_of_Search__c field of Background_Search__c object, if oPreEmployCase variable is not null and the value of Subject_of_Search__c field of Background_Search__c is equal to null.
4. Query on BGC_List_of_Services__c object:
Logic:
- Jurisdiction__c should be equal to null.
If above condition are matched then script fetch following fields:
Query:
- Query on BGC_List_of_Services__c object and fetch the value of id, Name, Location_Based__c, Location_Based_Type__c, Run_AKA_s__c and Specialty_Texas_Research__c fields based on SearchType__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in listblos list of BGC_List_of_Services__c object.
5. Update zipcode and state variable:
Logic:
- Jurisdiction__c should be equal to null.
- Additional_Address__c should not be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Additional_Address__c object and fetch the value of Zip_Code__c and State_Providence__c fields based on Additional_Address__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in listaa list of Additional_Address__c object.
- Set the value of zipcode variable from Zip_Code__c field of Additional_Address__c object, if the size of listaa list is greater than zero.
- Set the value of state variable from State_Providence__c field of Additional_Address__c object, if the size of listaa list is greater than zero.
6. Again update zipcode and state variable:
Logic:
- Jurisdiction__c should be equal to null.
- state or zipcode should be equal to null.
If above condition are matched then script update following fields:
Value assignment:
- Set the value of zipcode variable from Applicant_Zip_Code__c field of Background_Search__c object.
- Set the value of state variable from Applicant_State_Providence__c field of Background_Search__c object.
7. Update County__c field:
Logic:
- Jurisdiction__c and County__c should be equal to null.
- Applicant_Zip_Code__c or zipcode should not be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Zip_Code__c object and fetch the value of County__c and AssociatedCounty__c fields based on Applicant_Zip_Code__c field of Background_Search__c object OR zipcode variable.
Value assignment:
- Assign the value of above query in listzip list of Zip_Code__c object.
- Set the value of County__c field of Background_Search__c object from AssociatedCounty__c field of Zip_Code__c object, if size of listzip list is greater than zero and listzip list is not equal to null.
8. Update Location_Based_Type__c field, bSpclTaxResearch variable and assign the value of listblos list to singleblos object type variable:
Logic:
- Jurisdiction__c should be equal to null.
- Size of listblos list of BGC_List_of_Services__c object should be greater than zero.
If above condition are matched then script update following fields and list:
Value assignment:
- Assign the value of listblos list to singleblos variable of BGC_List_of_Services__c object.
- Set the value of Location_Based_Type__c field of Background_Search__c object from Location_Based_Type__c field of singleblos object type variable.
- Set the value of bSpclTaxResearch variable from Specialty_Texas_Research__c field of BGC_List_of_Services__c object.
9. Query on State_Providence__c object:
Logic:
- Merge the logic of point 8.
- singleblos variable of BGC_List_of_Services__c object and Applicant_State_Providence__c should not be equal to null.
- Name should not be equal to null.
- Name should be contain 'statewide'.
If above condition are matched then script fetch following fields:
Query:
- Query on State_Providence__c object and fetch the value of Statewide_Available__c and Name fields based on Applicant_State_Providence__c field of Background_Search__c object.
Value assignment:
- Set "('Background Search not Created. Statewide is not available for this state : '+ LstState.get(0).Name +'.')" value to addError field of Background_Search__c object if Statewide_Available__c field of State_Providence__c should be false.
10. Update Notes_Technical_Troubleshooting__c field of Background_Search__c object:
Logic:
- Merge the logic of point 8.
- singleblos variable of BGC_List_of_Services__c object should not be equal to null.
- Location_Based__c of BGC_List_of_Services__c object should be true.
If above condition are matched then script update following field:
Value assignment:
- Set "('BEFORE LOOKING JURIS Search subject state: ' + b.Applicant_State__c + ' List of Services: ' +singleblos.Name + ' state order: ' + b.Applicant_State_Providence__c + ' OR ' + state + ' zip order: ' + b.Applicant_Zip_Code__c + ' or ' + zipcode)" value to Notes_Technical_Troubleshooting__c field of Background_Search__c object.
11. Get Jurisdiction by County and get BGS owner:
Logic:
- Merge the logic of point 8 and point 10.
- Value of Location_Based_Type__c field of BGC_List_of_Services__c object should be equal to 'County'.
- County__c of Background_Search__c object should not be equal to null.
If above condition are matched then script fetch and update following fields:
Value assignment:
- Call "GetJurisListByCounty" method from "BackgroundSearchTriggercl" class and assign value from "GetJurisListByCounty" method to listjuris list.
- Assign the value of "GetJurisListByCounty" method to listjuris list of Jurisdiction__c object.
- Set value of listjuris list to singlejuris variable of Jurisdiction__c object, if the size of listjuris list should be greater than zero.
- Call "GetBGSOwner" method from "BackgroundSearchTriggercl" class and assign value from "GetBGSOwner" method to "b" the object of Background_Search__c object, if the size of listjuris list should be greater than zero.
12. Get Jurisdiction by State and get BGS owner:
Logic:
- Merge the logic of point 8 and point 10.
- Value of Location_Based_Type__c field of BGC_List_of_Services__c object should not be equal to 'County'.
- Value of Location_Based_Type__c field of BGC_List_of_Services__c object should be equal to 'Statewide' or 'International'.
If above condition are matched then script fetch and update following fields:
Value assignment:
- Update the value of Notes_Technical_Troubleshooting__c field of Background_Search__c object.
- Call "GetJurisListByState" method from "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object.
- Set value of listjuris list to singlejuris object of Jurisdiction__c object, if size of listjuris list is greater than zero.
- Call "GetBGSOwner" method from "BackgroundSearchTriggercl" class and assign value from "GetBGSOwner" method to "b" the object of Background_Search__c object, if the size of listjuris list is greater than zero.
- Call "GetJurisListByState" method from "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object, if size of listjuris list is equal to zero.
- Set value of listjuris list to singlejuris object of Jurisdiction__c object, if size of listjuris list is greater than zero.
- Call "GetBGSOwner" method from "BackgroundSearchTriggercl" class and assign value from "GetBGSOwner" method to "b" the object of Background_Search__c object, if the size of listjuris list is greater than zero.
13. Check duplicate Background Search record:
Logic:
- Merge the logic of point 8 and point 10.
- Location_Based_Type__c of BGC_List_of_Services__c object should not be equal to null and blank.
- County__c or Applicant_State_Providence__c field of Background_Search__c object should not be equal to null.
- Jurisdiction__c, Name_to_Search_First__c and Name_to_Search_Last__c field of Background_Search__c object should not be equal to null.
- Status_Standard__c of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch and update following fields:
Value assignment:
- Call "FillListBackGroundSearch" method from "BackgroundSearchTriggercl" class and assign value from "FillListBackGroundSearch" method to listbs list of Background_Search__c object.
13.1. Check duplicate Background Search record:
Logic:
- Size of listbs list should be greater than zero.
- Service_Ordered__c of listbs list should not be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on BGC_S_O_Individual__c object and get the value of Id and BGC_Package_Item__c based on value of Service_Ordered__c field of listbs list.
Value assignment:
- Value of above query assign to oBGCSOIndividual object of BGC_S_O_Individual__c object.
If above condition are not matched then script update following field:
Value assignment:
- Set "'Background Search not created: Search of this type, jurisdiction and name already exists [Search Number:['+listbs.get(0).Name+']].'" value to addError field of Background_Search__c object.
13.1.1. Check duplicate Background Search record:
Logic:
- Id of BGC_S_O_Individual__c object should not be equal to null.
- BGC_Package_Item__c of BGC_S_O_Individual__c object should not be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on BGC_Package_Items__c object and fetch the value of Id, Jurisdiction_Specific__c, Specific_Jurisdiction__c, Specific_Jurisdiction__r.State_Providence__c fields based on value of BGC_Package_Item__c field of BGC_S_O_Individual__c object.
Value assignment:
- Assign the value of above query in oBGCPackageItem object of BGC_Package_Items__c object.
If above condition are not matched then script update following field:
Value assignment:
- Set "'Background Search not created: Search of this type, jurisdiction and name already exists [Search Number:['+listbs.get(0).Name+']].'" value to addError field of Background_Search__c object.
13.1.1.1. Check duplicate Background Search record:
Logic:
- Value of Id, Specific_Jurisdiction__c and Specific_Jurisdiction__r.State_Providence__c field of BGC_Package_Items__c object should be equal to null.
- Value of Jurisdiction_Specific__c field of BGC_Package_Items__c object should not be true.
- Value of Specific_Jurisdiction__r.State_Providence__c field of BGC_Package_Items__c object should be equal to value of Applicant_State_Providence__c field of Background_Search__c object.
If above condition are matched then script update following fields:
Value assignment:
- Set "'Background Search not created: Search of this type, jurisdiction and name already exists [Search Number:['+listbs.get(0).Name+']].'" value to addError field of Background_Search__c object.
14. Update Notes_Technical_Troubleshooting__c field of Background_Search__c object:
Logic:
- Merge the logic of point 8.
- value of Location_Based__c field of BGC_List_of_Services__c object should be false.
If above condition are matched then script update following fields:
Value assignment:
- Set "'NOT Location Based=True, if not here Search Type not defined in Juris or no Active - BEFORE LOOKING JURIS Search subject state: ' + b.Applicant_State__c + ' List of Services Named: ' + singleblos.Name" value to Notes_Technical_Troubleshooting__c field of Background_Search__c object.
14.1. Get Jurisdiction List By State:
Logic:
- value of Name field of BGC_List_of_Services__c object should be equal to 'Motor Vehicle Report'.
If above condition are matched then script update following fields:
Value assignment:
- Update the value of Notes_Technical_Troubleshooting__c field of Background_Search__c object.
- Call "GetJurisListByState" method of "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object.
14.2. Get Jurisdiction List By State:
Logic:
- value of Name field of BGC_List_of_Services__c object should be equal to 'Child Abuse Registry'.
If above condition are matched then script update following fields:
Value assignment:
- Update the value of Notes_Technical_Troubleshooting__c field of Background_Search__c object.
- Call "GetJurisListByState" method of "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object.
14.3. Get Jurisdiction List By State:
Logic:
- value of Name field of BGC_List_of_Services__c object should not be equal to 'Motor Vehicle Report' and 'Child Abuse Registry'.
If above condition are matched then script update following fields:
Value assignment:
- Call "GetJurisListByState" method of "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object.
14.4. Get BGS Owner:
Logic:
- Size of listjuris list of Jurisdiction__c object should be greater than zero.
If above condition are matched then script update following fields:
Value assignment:
- Assign listjuris list to singlejuris object.
- Call "GetBGSOwner" method of "BackgroundSearchTriggercl" class and assign value from "GetBGSOwner" method to "b" object variable of Background_Search__c object.
14.5. Get BGS Owner and get Jurisdiction List By State:
Logic:
- Size of listjuris list of Jurisdiction__c object should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Call "GetJurisListByState" method of "BackgroundSearchTriggercl" class and assign value from "GetJurisListByState" method to listjuris list of Jurisdiction__c object.
- Assign listjuris list to singlejuris object, if the size of listjuris list is greater than zero.
- Call "GetBGSOwner" method of "BackgroundSearchTriggercl" class and assign value from "GetBGSOwner" method to "b" object variable of Background_Search__c object, if the size of listjuris list is greater than zero.
15. Query on PreEmploy_Case__c object:
Logic:
- Jurisdiction__c and PreEmploy_Case__c field of Background_Search__c object should not be equal to null.
- value of Search_Type_Name__c field of Background_Search__c object should not be equal to 'Statewide Research'.
If above condition are matched then script fetch and update following fields:
Query:
- Query on PreEmploy_Case__c object and fetch the value of Previous_Hits_Present__c based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query to oRelatedCase object of PreEmploy_Case__c object.
- Call "timestamp" method of "Salesforcecl" and assign the value of "timestamp" method to Notes_Internal__c field of Background_Search__c object, the oRelatedCase variable is not null and the value of Previous_Hits_Present__c field of PreEmploy_Case__c object is true.
II. Trigger.isBefore and Trigger.isUpdate
1. Fetch record from PreEmploy_Case__c object and update Case RecordType:
Logic:
- PreEmploy_Case__c field of Background_Search__c object should not be equal to null.
- value of Search_Complete__c field of Background_Search__c object should be false.
If above condition are matched then script fetch and update following fields:
Query:
- Query on PreEmploy_Case__c object and fetch the value of Report_Case_Closed__c field based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query to oPreEmployCase object of PreEmploy_Case__c object.
- Call "UpdateCaseRecordType" of "BackgroundSearchTriggercl" class and pass PreEmploy_Case__c field of Background_Search__c as a parameter, if oPreEmployCase variable is not null and value of Report_Case_Closed__c field of PreEmploy_Case__c object is true.
2. Insert Background_Search__c record:
Logic:
- value of Search_Type_Name__c field of Background_Search__c object should be equal to 'County Criminal' or 'County Civil'.
- value of Sister_County__c field of Background_Search__c object should be false.
If above condition are matched then script assignment the value in following fields:
Value assignment:
- Create Background_Search__c record as per current values of Background_Search__c record.
3. Update County__c field of Background_Search__c object:
Logic:
- County__c of Background_Search__c object should be equal to null.
- Applicant_Zip_Code__c of Background_Search__c object should not be equal to null.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Zip_Code__c object and fetch the value of County__c and AssociatedCounty__c field based on Applicant_Zip_Code__c field of Background_Search__c object.
Value assignment:
- Value of above query assign to listzip list of Zip_Code__c object.
- Assign value of AssociatedCounty__c field of Zip_Code__c to County__c of Background_Search__c object, if size of listzip list greater than zero.
4. Insert Search Restriction:
Logic:
- value of Jurisdiction__c field of Background_Search__c object should not be equal to null.
- value of Search_Type_Name__c field of Background_Search__c object should not be equal to 'Statewide Research'.
- value of Status_Standard__c field of Background_Search__c object should not be equal to 'Hold'.
- value of Search_Restriction__c field of Background_Search__c object should not be equal to 'Approved to Run Industry Restricted Search'.
If above condition are matched then script update following fields:
Value assignment:
- Call "InsertSearchRestriction" method of "BackgroundSearchTriggercl" class and pass object of Background_Search__c object as a parameter.
III. Trigger.isAfter and Trigger.isUpdate
1. Update the record of Verification__c object:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Cancelled/Not Requested'.
- value of Service_Classification__c field of Background_Search__c object should be equal to 'Verification'.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Verification__c object and fetch the value of id, Status__c, Search_Complete__c field based on id of Background_Search__c object.
Value assignment:
- Value of above query assign to listver list of Verification__c object.
- Assign the value of Status__c field of Verification__c object to sStatus variable, if size of listver list should be greater than zero.
- Set 'Cancelled' on Status__c field of Verification__c object, if value of sStatus variable should not be equal to 'Cancelled'.
- Set true on Search_Complete__c field of Verification__c object, if value of sStatus variable should not be equal to 'Cancelled'.
2. Query on Background_Search__c object:
Logic:
- Value of Search_Complete__c field of Background_Search__c object should be true.
OR
- value of Search_Type_Name__c field of Background_Search__c should be equal to 'Credit Report' or 'Motor Vehicle Report'.
If above condition are matched then script fetch and update following fields.
Query:
- Query on Background_Search__c object and fetch the value of Status_Standard__c, Invalid__c, Ready_for_Processing__c, RecordTypeId, Search_Type_Name__c,Search_Complete__c, Clear_Search__c, All_Clear__c field based on PreEmploy_Case__c of Background_Search__c object.
Value assignment:
- Assign the value of above query to listbs list of Background_Search__c object.
- Set false on bHit variable.
- Add one on countTotal variable.
2.1.1. Update countInvalid variable:
Logic:
- value of Invalid__c field of Background_Search__c object should be true.
If above condition are matched then script update following field:
Value assignment:
- Add one on countInvalid variable.
2.1.2. Update countReadyForProcessing variable:
Logic:
- value of Ready_for_Processing__c field of Background_Search__c object should be false.
If above condition are matched then script update following field:
Value assignment:
- Add one on countReadyForProcessing variable.
2.1.3. Update countSearchComplete variable:
Logic:
- value of Search_Complete__c field of Background_Search__c object should be true.
If above condition are matched then script update following field:
Value assignment:
- Add one on countSearchComplete variable.
2.1.4. Update countClear variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Clear'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countClear variable.
2.1.5. Update countComplete variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Complete'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countComplete variable.
2.1.6.1. Update countCancelled variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Cancelled/Not Requested'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countCancelled variable.
2.1.6.2. Update countCancelled variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Not Requested'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countCancelled variable.
2.1.6.3. Update countCancelled variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Cancelled'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countCancelled variable.
2.1.7. Update countHit variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Hit' or 'Unverified Hit' or 'Needs Review'.
- value of Search_Complete__c field of Background_Search__c object should be true.
If above condition are matched then script update following field.
Value assignment:
- Add one on countHit variable.
2.1.8. Update countNeedsReview variable:
Logic:
- value of Status_Standard__c field of Background_Search__c object should be equal to 'Needs Review'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countNeedsReview variable.
2.1.9. Update countOtherStatus variable:
Logic:
- Value of Status_Standard__c field of Background_Search__c object should not be equal to 'Needs Review' OR 'Unverified Hit' OR 'Hit' OR 'Cancelled' OR 'Not Requested' OR 'Cancelled/Not Requested' OR 'Complete' OR 'Clear'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countOtherStatus variable.
2.1.10. Update countSearchTypeSSN variable:
Logic:
- value of Search_Type_Name__c field of Background_Search__c object should be equal to 'SSN Address Locator'.
- value of Search_Complete__c field of Background_Search__c object should be true.
If above condition are matched then script update following field:
Value assignment:
- Add one on countSearchTypeSSN variable.
2.1.11. Update countSearchTypeCredit variable:
Logic:
- value of Search_Type_Name__c field of Background_Search__c object should be equal to 'Credit Report'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countSearchTypeCredit variable.
2.1.12. Update countSearchTypeMotor variable:
Logic:
- value of Search_Type_Name__c field of Background_Search__c object should be equal to 'Motor Vehicle Report'.
If above condition are matched then script update following field:
Value assignment:
- Add one on countSearchTypeMotor variable.
2.2. Query on RecordType object:
Logic:
- value of countInvalid variable should be equal to zero.
- value of countTotal variable should be greater than zero.
If above condition are matched then script fetch and update following field:
Query:
- Query on RecordType object and fetch the value of id, Name, SobjectType field based on Name should be equal to 'Cancelled' OR Name should be equal to 'Graded Clear/Pass' OR Name should be equal to 'Graded_Clear_Pass' OR Name should be equal to 'Complete' OR Name should be equal to 'Pending Grading' OR Name should be equal to 'Pending_Grading' AND SobjectType should be equal to 'Background_Search__c' OR SobjectType should be equal to 'PreEmploy_Case__c'.
Value assignment:
- Assign the value of above query to listrt list of RecordType object.
2.2.1. Update CompleteRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Complete'.
- value of SobjectType field of RecordType object should be equal to 'Background_Search__c'.
If above condition are matched then script update following field.
Value assignment:
- Assign the value of rectype object of RecordType object to CompleteRecordType variable.
2.2.2. Update CancelledRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Cancelled'.
- SobjectType of RecordType object should be equal to 'Background_Search__c'.
If above condition are matched then script update following field.
Value assignment:
- Assign the value of rectype object of RecordType object to CancelledRecordType variable.
2.2.3. Update GradedPassRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Graded_Clear_Pass' or 'Graded Clear/Pass'.
- SobjectType of RecordType object should be equal to 'Background_Search__c'.
If above condition are matched then script update following field:
Value assignment:
- Assign the value of rectype object of RecordType object to GradedPassRecordType variable.
2.2.4. Update CaseCompleteRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Complete'.
- SobjectType of RecordType object should be equal to 'PreEmploy_Case__c'.
If above condition are matched then script update following field:
Value assignment:
- Assign the value of rectype object type variable of RecordType object to CaseCompleteRecordType variable.
2.2.5. Update CaseGradedPassRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Graded_Clear_Pass' or 'Graded Clear/Pass'.
- SobjectType of RecordType object should be equal to 'PreEmploy_Case__c'.
If above condition are matched then script update following field:
Value assignment:
- Assign the value of rectype object of RecordType object to CaseGradedPassRecordType variable.
2.2.6. Update PendingGradingRecordType variable:
Logic:
- value of Name field of RecordType object should be equal to 'Pending Grading' or 'Pending_Grading'.
- SobjectType of RecordType object should be equal to 'PreEmploy_Case__c'.
If above condition are matched then script update following field:
Value assignment:
- Assign the value of rectype object of RecordType object to PendingGradingRecordType variable.
2.3. Fetch the record on PreEmploy_Case__c object:
Logic:
- countSearchComplete variable should be equal to countTotal variable.
If above condition are matched then script fetch and update following field:
Query:
- Query on PreEmploy_Case__c object and fetch the value of id, Name, Account_Name__c, Account__c, IsAllSearchesClosed__c, IsHitSearchPresent__c, IsAllSearchesCancelled__c, Report_Closed_Date__c, IsDelayComplete__c, Is8HoursDelayActivated__c, Invite_User_to_MBCR__c, MBC_User_Created__c, Report_Case_Status__c, Distributed_for_Formation__c, Formation_Complete__c, Queue_For_Grading__c, Report_Case_Closed__c, Subject_First_Name__c, Subject_Last_Name__c, No_Subject_of_Background_Contact__c, Subject_Email__c, Grading_Complete__c, RecordTypeId, Subject_of_background__c, Report_Case_Grade__c fields based on PreEmploy_Case__c field of Background_Search__c object AND Report_Case_Closed__c should be false AND Contact_Has_Dispute__c should be false AND Formation_Complete__c should be true.
Value assignment:
- Value of above query assign to listpc list of PreEmploy_Case__c object.
2.3.1. Create MBCR User:
Logic:
- Size of listpc list should be greater than zero.
- Value of countSearchTypeCredit or countSearchTypeMotor or countHit or countNeedsReview variable should be greater than zero.
- Value of Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
- Value of Subject_of_background__c field of PreEmploy_Case__c object should be equal to null.
- Value of Status_Standard__c field of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch and update following fields:
Create Contact:
- Call "CreateContact" method of "MBCRUserCreation" class for create Contact record.
Query:
- Query on User object and fetch the value of Id field based on id of Contact object should be equal to Subject_of_background__c of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create an user, if the size of LstUserProfile list is equal to zero.
- Set true on MBC_User_Created__c field of PreEmploy_Case__c object, if the size of LstUserProfile list is equal to zero.
- Call "setSubjectOfSearchCall" method of this trigger for update Subject_Of_Search__c field, if the size of LstUserProfile list is equal to zero.
- Set true on Is8HoursDelayActivated__c field of PreEmploy_Case__c object.
- Set current datetime on Hours8DelayStartTime__c field of PreEmploy_Case__c object.
2.3.2. Create MBCR User:
Logic:
- Merge the logic of 2.3.1 point
- Value of Subject_of_background__c field of PreEmploy_Case__c object should not be equal to null.
- Value of MBC_User_Created__c field of PreEmploy_Case__c object should not be true.
- Value of Status_Standard__c field of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Contact object and fetch the value of accountID field based on Subject_of_background__c of PreEmploy_Case__c object and assign the value of query in LstCon list of Contact object.
Delete Contact:
- Delete the value of LstCon list, if accountID of Contact object should be equal to null.
Create Contact:
- Call "CreateContact" method of "MBCRUserCreation" class for create Contact record.
Query:
- Query on User object and fetch the value of Id field based on id of Contact object should be equal to Subject_of_background__c of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create an user, if the size of LstUserProfile list is equal to zero.
- Set true on MBC_User_Created__c field of PreEmploy_Case__c object, if the size of LstUserProfile list is equal to zero.
- Call "setSubjectOfSearchCall" method of this trigger for update Subject_Of_Search__c field, if the size of LstUserProfile list is equal to zero.
- Set true on Is8HoursDelayActivated__c field of PreEmploy_Case__c object.
- Set current datetime on Hours8DelayStartTime__c field of PreEmploy_Case__c object.
2.3.3. Fetch the data from BGC_Configuration__c object:
Logic:
- Size of listpc list should be greater than zero.
If above condition are matched then script fetch and update following fields:
Query:
- Query on BGC_Configuration__c object and fetch the value of id, Grading_Pass_Verbiage__c, Enabled_Grading_for_Audit__c, Enabled_Grading__c, Grading_Do_Not_Auto_Clear__c fields based on Account__c field of PreEmploy_Case__c object AND Enabled_Grading__c should be true or Enabled_Grading_for_Audit__c should be true.
Value assignment:
- Assign the value of above query to listbc list of BGC_Configuration__c object.
2.3.3.1. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be greater than zero.
- Sum of countClear, countComplete and countCancelled variables should be equal to countTotal variable.
- Value of countCancelled variable should not be equal to value of countTotal variable.
- Value of countHit variable should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Set True on IsAllSearchesClosed__c field, set False on IsHitSearchPresent__c and IsAllSearchesCancelled__c field of PreEmploy_Case__c object.
- Set value of Grading_Pass_Verbiage__c field of BGC_Configuration__c object to Report_Case_Grade__c field of PreEmploy_Case__c object, if value of Grading_Do_Not_Auto_Clear__c field should be false AND value of Grading_Pass_Verbiage__c field should not be equal to null AND Grading_Pass_Verbiage__c field should not be blank.
- Set 'Complete - All Results Clear' on Report_Case_Status__c field of PreEmploy_Case__c object, if value of Grading_Do_Not_Auto_Clear__c field should be false AND value of countClear variable should be greater than zero.
- Set 'Complete' on Report_Case_Status__c field of PreEmploy_Case__c object, if value of Grading_Do_Not_Auto_Clear__c field should be false AND value of countClear variable should be equal to zero.
- Call "SetCaseValueAfterUpdate" method of "BackgroundSearchTriggercl" class, if value of Grading_Do_Not_Auto_Clear__c field should be false.
- Call "SetCaseValueAfterUpdate" method of "BackgroundSearchTriggercl" class with different parameter, if value of Grading_Do_Not_Auto_Clear__c field should be true.
2.3.3.2. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be greater than zero.
- Value of countCancelled variable should be equal to value of countTotal variable.
- Value of countHit variable should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Set True on IsAllSearchesClosed__c and IsAllSearchesCancelled__c field, set False on IsHitSearchPresent__c of PreEmploy_Case__c object.
- Call "SetCaseValueAfterUpdate" method of "BackgroundSearchTriggercl" class.
2.3.3.3. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list and value of countHit variable should be greater than zero.
If above condition are matched then script update following fields:
Value assignment:
- Set True on IsAllSearchesClosed__c and IsHitSearchPresent__c field, set False on IsAllSearchesCancelled__c of PreEmploy_Case__c object.
- Call "SetCaseValueAfterUpdate" method of "BackgroundSearchTriggercl" class.
2.3.3.4. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be equal to zero.
- Value of countCancelled variable should be equal to value of countTotal variable.
- Value of countHit variable should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Set 'Cancelled - Per Client Request' on Report_Case_Status__c field of PreEmploy_Case__c object.
- Set CaseCompleteRecordType.Id on RecordTypeId field of PreEmploy_Case__c object.
2.3.3.5. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be equal to zero.
- Sum of countClear variable, countComplete variable, countCancelled variable should be equal to value of countTotal variable.
- Value of countHit variable should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Set 'Complete - All Results Clear' on Report_Case_Status__c field of PreEmploy_Case__c object, if value of countClear variable should be greater than zero.
- Set 'Complete' on Report_Case_Status__c field of PreEmploy_Case__c object, if value of countClear variable should be equal to zero.
- Set CaseCompleteRecordType.Id on RecordTypeId field of PreEmploy_Case__c object.
2.3.3.6. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be equal to zero.
- Value of countHit variable should be greater than zero.
If above condition are matched then script update following fields:
Value assignment:
- Set 'Complete - Review Needed' on Report_Case_Status__c field of PreEmploy_Case__c object.
- Set CaseCompleteRecordType.Id on RecordTypeId field of PreEmploy_Case__c object.
2.3.3.7. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listbc list should be equal to zero.
If above condition are matched then script update following fields:
Value assignment:
- Set True on Report_Case_Closed__c field of PreEmploy_Case__c object, if Is8HoursDelayActivated__c field should be false AND IsDelayComplete__c should be true.
- Set current datetime on Report_Closed_Date__c field of PreEmploy_Case__c object, if Is8HoursDelayActivated__c field should be false AND IsDelayComplete__c should be true.
- Set false on Queue_For_Grading__c field of PreEmploy_Case__c object.
2.4. Fetch the record on PreEmploy_Case__c object:
Logic:
- countSearchComplete variable should not be equal to countTotal variable.
If above condition are matched then script fetch following fields:
Query:
- Query on PreEmploy_Case__c object and fetch the value of id, Name, Account_Name__c, Account__c, Report_Closed_Date__c, IsDelayComplete__c, Is8HoursDelayActivated__c, Invite_User_to_MBCR__c, MBC_User_Created__c, Report_Case_Status__c, Distributed_for_Formation__c, Formation_Complete__c, Queue_For_Grading__c, Report_Case_Closed__c, Subject_First_Name__c, Subject_Last_Name__c, No_Subject_of_Background_Contact__c, Subject_Email__c, Grading_Complete__c, RecordTypeId, Subject_of_background__c, Report_Case_Grade__c based on PreEmploy_Case__c field of Background_Search__c object AND Report_Case_Closed__c should be false.
2.4.1. Create MBCR User:
Logic:
- Size of listpc list and (value of countSearchTypeCredit OR countSearchTypeMotor OR countHit OR countNeedsReview variable) should be greater than zero.
- Value of Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
- Value of Subject_of_background__c field of PreEmploy_Case__c object should be equal to null.
- Value of Status_Standard__c field of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch and update following fields:
Create Contact:
- Call "CreateContact" method of "MBCRUserCreation" class for create Contact record.
Query:
- Query on User object and fetch the value of Id field based on id of Contact object should be equal to Subject_of_background__c of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create an user.
- Set true on MBC_User_Created__c field of PreEmploy_Case__c object.
- Call "setSubjectOfSearchCall" method of this trigger for update Subject_Of_Search__c field.
- Set true on Is8HoursDelayActivated__c field of PreEmploy_Case__c object.
- Set current datetime on Hours8DelayStartTime__c field of PreEmploy_Case__c object.
2.4.2. Create MBCR User:
Logic:
- Size of listpc list should be greater than zero.
- Value of countSearchTypeCredit OR countSearchTypeMotor OR countHit OR countNeedsReview variable should be greater than zero.
- Value of Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
- Value of Subject_of_background__c field of PreEmploy_Case__c object should not be equal to null.
- Value of MBC_User_Created__c field of PreEmploy_Case__c object should not be true.
- Value of Status_Standard__c field of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch and update following fields:
Query:
- Query on Contact object and fetch the value of accountID field based on Subject_of_background__c of PreEmploy_Case__c object and assign the value of query in LstCon list of Contact object.
Delete Contact:
- Delete the value of LstCon list, if accountID of Contact object should be equal to null.
Create Contact:
- Call "CreateContact" method of "MBCRUserCreation" class for create Contact record.
Query:
- Query on User object and fetch the value of Id field based on id of Contact object should be equal to Subject_of_background__c of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create an user.
- Set true on MBC_User_Created__c field of PreEmploy_Case__c object.
- Call "setSubjectOfSearchCall" method of this trigger for update Subject_Of_Search__c field.
- Set true on Is8HoursDelayActivated__c field of PreEmploy_Case__c object.
- Set current datetime on Hours8DelayStartTime__c field of PreEmploy_Case__c object.
IV. Trigger.isAfter and Trigger.isInsert
1.1. Fetch the data from BGC_DTOC_Order__c object:
Logic:
- Value of Search_Type_Name__c field of Background_Search__c object should not be equal to null.
- Value of Search_Type_Name__c field of Background_Search__c object should be condition 'drug test' OR 'occ health'.
If above condition are matched then script fetch and update following fields.
Query:
- Query on BGC_DTOC_Order__c object and fetch the value of Id, Background_Search__c fields based on PreEmploy_Case__c field of Background_Search__c object AND Order_Details__c should not be equal to null AND Order_Details__c should be LIKE value of sSearch variable.
Value assignment:
- Set 'Occupational' on sSearchType variable, if Search_Type_Name__c field should be contain 'occ health'.
- Set '%'+sSearchType+'%' on sSearch variable.
- Assign the value of above query on oDTOC list of BGC_DTOC_Order__c object.
1.2. Update the record of BGC_DTOC_Order__c object:
Logic:
- Merge the logic of point 1.1 .
- Size of oDTOC list should be greater than zero.
If above condition are matched then script update following fields:
Value assignment:
- Assign the value of oDTOC list to oDTOCId object of BGC_DTOC_Order__c object.
- Set Id of Background_Search__c object to Background_Search__c field of BGC_DTOC_Order__c object.
2. Create Statewide Search record:
Logic:
- Jurisdiction__c of Background_Search__c object should not be equal to null.
- Search_Type_Name__c of Background_Search__c object should be equal to 'County Criminal'.
If above condition are matched then script call following method:
Call Method:
- Call "AddStateWiseSearch" method of this trigger.
3. Fetch the data in PreEmploy_Case__c object:
Logic:
- Search_Type_Name__c of Background_Search__c object should be equal to 'Credit Report' OR 'Motor Vehicle Report'.
- Status_Standard__c of Background_Search__c object should not be equal to 'Cancelled/Not Requested'.
If above condition are matched then script fetch following fields:
Query:
- Query on PreEmploy_Case__c object and fetch the value of Id, Name, Account_Name__c, Is8HoursDelayActivated__c, Hours8DelayStartTime__c, IsDelayComplete__c, Subject_of_background__c, Subject_First_Name__c, Subject_Last_Name__c, Invite_User_to_MBCR__c, No_Subject_of_Background_Contact__c, Subject_Email__c, account__c, isCaseCreate__c, Report_Closed_Date__c, MBC_User_Created__c, Report_Case_Status__c, Distributed_for_Formation__c fields based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in listpc list of PreEmploy_Case__c object.
3.1. Create contact and fetch the data in User object:
Logic:
- Size of listpc list should be greater than zero.
- value of Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
- Subject_of_background__c of PreEmploy_Case__c object should be equal to null.
If above condition are matched then script fetch, update and create following records:
Call Method:
- Call "CreateContact" method of "MBCRUserCreation" class for create MBCR user contact.
Query:
- Query on User object to fetch the value of Id field based on Subject_of_background__c field of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create MBCR user, if size of LstUserProfile list should be equal to zero.
- Call "setSubjectOfSearchCall" method of this trigger, if size of LstUserProfile list should be equal to zero.
- Set true in MBC_User_Created__c field of PreEmploy_Case__c object, if size of LstUserProfile list should be equal to zero.
3.2. Create contact and fetch the data in User object:
Logic:
- Size of listpc list should be greater than zero.
- Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
- Subject_of_background__c of PreEmploy_Case__c object should not be equal to null.
If above condition are matched then script fetch, update and create following records:
Query:
- Query on Contact object to fetch the value of accountID field based on Subject_of_background__c field of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstCon list of Contact object.
- Delete the value of LstCon list, if size of LstCon list should be greater than zero AND accountID field should be equal to null.
- Call "CreateContact" method of "MBCRUserCreation" class for create MBCR user contact, if size of LstCon list should be greater than zero AND accountID field should be equal to null.
Query:
- Query on User object to fetch the value of Id field based on Subject_of_background__c field of PreEmploy_Case__c object.
Value assignment:
- Assign the value of above query in LstUserProfile list of User object.
- Call "CreateUser" method of "MBCRUserCreation" class for create MBCR user, if size of LstUserProfile list should be equal to zero.
- Call "setSubjectOfSearchCall" method of this trigger, if size of LstUserProfile list should be equal to zero.
- Set true in MBC_User_Created__c field of PreEmploy_Case__c object, if size of LstUserProfile list should be equal to zero.
3.3. Update the fields of PreEmploy_Case__c object:
Logic:
- Size of listpc list should be greater than zero.
- value of Is8HoursDelayActivated__c and IsDelayComplete__c field of PreEmploy_Case__c object should be false.
If above condition are matched then script update following fields:
Value assignment:
- Set true on Is8HoursDelayActivated__c field.
- Set current datetime on Hours8DelayStartTime__c field.
V. AddStateWiseSearch method
Query:
- Query on Jurisdiction__c object, fetch the value of Id, State_Providence__c, State_Providence__r.Statewide_Research_Addition__c fields based on Jurisdiction__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in LstJurisSearch list of Jurisdiction__c object.
1. Update the value of bIsStatewideResearchAddition and sJurisState variable:
Logic:
- Value of Id and State_Providence__c field of Jurisdiction__c object should not be equal to null.
If above condition are matched then script update following variables:
Value assignment:
- Set the value of State_Providence__r.Statewide_Research_Addition__c field of Jurisdiction__c object to bIsStatewideResearchAddition variable.
- Set the value of State_Providence__c field of Jurisdiction__c sJurisState variable.
2.1. Update the value of sOrderId and sSubjectOfBackground variable:
Logic:
- Value of bIsStatewideResearchAddition variable should be true.
- Value of Service_Ordered__c field of Background_Search__c object should not be equal to null.
If above condition are matched then script update following variables:
Query:
- Query on PreEmploy_Case__c object, fetch the value of Id, Order_Number__c, Subject_of_background__c fields based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query in LstCaseOrder list of PreEmploy_Case__c object.
- Set the value of Order_Number__c field of PreEmploy_Case__c object to sOrderId variable, if size of LstCaseOrder list should be greater than zero.
- Set the value of Subject_of_background__c field of PreEmploy_Case__c object to sSubjectOfBackground variable, if size of LstCaseOrder list should be greater than zero.
2.2. Update the value of iCount variable:
Logic:
- Value of bIsStatewideResearchAddition variable should be true.
- Value of sOrderId variable and value of Service_Ordered__c field of Background_Search__c object should not be equal to null.
If above condition are matched then script fetch the count of records:
Query:
- Query on BGC_S_O_Individual__c object, fetch the Count of record based on sOrderId variable AND Selected_Service__r.Name should be equal to 'Statewide Criminal' OR Selected_Service__r.Name should be equal to 'Statewide Search' OR Selected_Service__r.Name should be equal to 'Statewide Research'.
Value assignment:
- Assign the value of above query to iCount variable.
3.1. Update the value of iCount, sOrderId, sOrderState and sSubjectOfBackground variable:
Logic:
- Value of bIsStatewideResearchAddition variable should be true.
- Value of Service_Ordered__c field of Background_Search__c object should be equal to null.
If above condition are matched then script fetch the count of records:
Query:
- Query on Background_Search__c object, fetch the Id based on PreEmploy_Case__c, Alternate_Name__c, Archived_Alternate_Name_ID__c fields of Background_Search__c object AND sJurisState variable AND SearchType__r.Name should be equal to 'Statewide Criminal' OR SearchType__r.Name should be equal to 'Statewide Research' OR SearchType__r.Name should be equal to 'Statewide Search'.
Value assignment:
- Assign the value of above query to LstBGS list of Background_Search__c object.
- Assign the size LstBGS list to iCount variable.
Query:
- Query on PreEmploy_Case__c object, fetch the Id, Order_Number__c, Order_Number__r.State_Providence__c, Subject_of_background__c based on PreEmploy_Case__c field of Background_Search__c object.
Value assignment:
- Assign the value of above query to LstCaseOrder list of PreEmploy_Case__c object.
- Set the value of Order_Number__c field of PreEmploy_Case__c object to sOrderId variable, if the size of LstCaseOrder list should be greater than zero.
- Set the value of Order_Number__r.State_Providence__c field of PreEmploy_Case__c object to sOrderState variable, if the size of LstCaseOrder list should be greater than zero.
- Set the value of Subject_of_background__c field of PreEmploy_Case__c object to sSubjectOfBackground variable, if the size of LstCaseOrder list should be greater than zero.
3.2. Update the value of iCount variable:
Logic:
- Value of bIsStatewideResearchAddition variable should be true.
- Value of Service_Ordered__c, Archived_Alternate_Name_ID__c and Alternate_Name__c field of Background_Search__c object should be equal to null.
- Value of Archived_Additional_Address_ID__c or additional_address__c field of Background_Search__c object should not be equal to null.
- Value of iCount variable should be equal to zero.
- Value of sOrderId variable should not be equal to null.
If above condition are matched then script fetch the count of records:
Query:
Query:
- Query on BGC_S_O_Individual__c object, fetch the Count of record based on sOrderId variable AND Selected_Service__r.Name should be equal to 'Statewide Criminal' OR Selected_Service__r.Name should be equal to 'Statewide Search' OR Selected_Service__r.Name should be equal to 'Statewide Research'.
Value assignment:
- Assign the value of above query to iCount variable.
- Set zero on iCount variable, if value of sOrderState variable should not be equal to value of Applicant_State_Providence__c field of Background_Search__c object.
3.2. Create "Statewide Search" type search:
Logic:
- Value of bIsStatewideResearchAddition variable should be true.
- Value of iCount variable should be equal to zero.
If above condition are matched then script update the following fields:
Value assignment:
- Create Background_Search__c record as per current values of Background_Search__c record.
VI. getIsSpclTaxResearch method
This method is a parameterized method and it contain two parameter, one is bSpcltaxR variable that is boolean data type and other one is bgs object of Background_Search__c object.
1. Update the value of bSpcltaxR variable:
Logic:
- Value of bSpcltaxR variable should be true.
If above condition are matched then script fetch and update the following fields:
Query:
- Query on BGC_Configuration__c object and fetch the value of id, Specialty_Texas_Research__c field, based on Account__c of Background_Search__c object.
Value assignment:
- Assign the value of above query on lstBgcConfig1 list of BGC_Configuration__c object.
- Set true on bSpcltaxR variable, if size of lstBgcConfig1 list should be greater than zero AND Specialty_Texas_Research__c should be true.
VII. setSubjectOfSearchCall method
This method is a parameterized method and it contain one parameter, sBGCase parameter is string data type.
1. Set the value of Subject_Of_Search__c field of Background_Search__c object:
Logic:
- Value of sBGCase variable should not be equal to null and blank.
If above condition are matched then script fetch and update the following fields:
Query:
- Query on Background_Search__c object with limit 100 and fetch the value of id, Subject_of_Search__c fields based on sBGCase variable AND Subject_of_Search__c should be equal to null.
Value assignment:
- Assign the value of above query in lstBGSearch list of Background_Search__c object.
- Add one by one value of lstBGSearch to lstBGS string type list, if size of lstBGSearch list is greater than zero.
- Call "setSubjectOfSearch" method of "BackgroundSearchTriggercl" class, if the size of lstBGS list is equal to "5".
- Clear the size of lstBGS list, if the size of lstBGS list is equal to "5".
2. Again set the value of Subject_Of_Search__c field of Background_Search__c object:
Logic:
- Merge the logic of point 1.
If above condition are matched then script fetch and update the following fields:
Query:
- Query on Background_Search__c object with limit 4 and fetch the value of id, Subject_of_Search__c fields based on sBGCase variable AND Subject_of_Search__c should be equal to null.
Value assignment:
- Assign the value of above query in lstBGSearch1 list of Background_Search__c object.
- Add one by one value of lstBGSearch1 to lstBGS1 string type list, if size of lstBGSearch1 list is greater than zero.
- Call "setSubjectOfSearch" method of "BackgroundSearchTriggercl" class.