bcgov / MOH-MAiD

Ministry of Health MAID Project
Apache License 2.0
2 stars 4 forks source link

BCMOHAD-24584 -v1 || Updated the flows, reports #852

Closed RanadheerRG closed 2 months ago

RanadheerRG commented 2 months ago

Description

Created a new field, added it to the pagelayout, recordtype, reports, permission sets and flows. Created new validated rule and updated the existing rule

POST Deployment Steps:

Once the deployment is Success, click on the setup

  1. Case obj, Validation rules, De-activate "Prevent_save_on_duplication_of_PHN", "Education_Provided","Was_Education_Provided_Not_Blank","Was_Education_Provided_And_Lvl_Selected"
  2. De-activate "MAiD Prevent Duplicate Phn" flow
  3. Select developer console, Open Execute Anonymus window

Paste the below code and execute it.

List caseList = [Select Id, RecordType.name, Was_education_providedc, Education_provided_to_practitioner__c From Case where recordtype.name='MAiD Error Log']; List caseListtoUpdate = new List(); Integer Yes =0; Integer No = 0; if(caseList != NULL && caseList.size()>0){ for(Case cs : caseList){ if(cs.Education_provided_to_practitionerc == TRUE){ cs.Was_education_providedc = 'Yes'; Yes = Yes+1;
}else{ cs.Was_education_provided
c = 'No'; No = No+1; } caseListtoUpdate.add(cs); } } if(caseListtoUpdate != NULL && caseListtoUpdate.size()>0){ update caseListtoUpdate; System.debug('caseListToUpdateSize'+caseListtoUpdate.size()); System.debug('Yes---->'+Yes); System.debug('No---->'+No); }

If in-case any error occurs while executing the code then do the following steps: Open Data Loader Select Export, select case object, paste the following query: Select Id, RecordType.name, Was_education_providedc, Education_provided_to_practitionerc From Case where recordtype.name='MAiD Error Log' Export the data into a .csv file Update the Was_Education_Providedc field with Yes, if Education_Provided_to_practioner is True Update the Was_Education_Providedc field with No, if Education_Provided_to_practioner is False or Blank and save the changes Select Update in data loader and select the case object and upload the .csv file

Once the code is Successfully executed then,

  1. Case obj, Validation rules, Activate "Prevent_save_on_duplication_of_PHN", "Education_Provided","Was_Education_Provided_Not_Blank","Was_Education_Provided_And_Lvl_Selected"
  2. Activate "MAiD Prevent Duplicate Phn" flow

Update the reports with Was_Education_provided__c field

Type of change

Checklist: