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
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"
De-activate "MAiD Prevent Duplicate Phn" flow
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_providedc = '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,
Case obj, Validation rules, Activate "Prevent_save_on_duplication_of_PHN", "Education_Provided","Was_Education_Provided_Not_Blank","Was_Education_Provided_And_Lvl_Selected"
Activate "MAiD Prevent Duplicate Phn" flow
Update the reports with Was_Education_provided__c field
Type of change
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
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
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_practitioner c == TRUE){
cs.Was_education_providedc = 'Yes';
Yes = Yes+1;
}else{ cs.Was_education_providedc = '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,
Update the reports with Was_Education_provided__c field
Type of change
Checklist: