Skip to content

Commit

Permalink
fieldApiName for 'First installment paid' checkbox is stored in Batch…
Browse files Browse the repository at this point in the history
…_Defaults to avoid translation issue
  • Loading branch information
salesforce-suyash-more committed Dec 6, 2024
1 parent 8809a6e commit 320654f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion force-app/main/default/classes/GiftBatch.cls
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public inherited sharing class GiftBatch implements IGiftBatch {
private GiftTemplate giftTemplate;

private Boolean shouldPayFirstInstallment = false;
private static final String AllowFirstInstallmentPaid = Label.get(null, 'geRD2FirstInstallmentPaid', UserInfo.getLanguage());
private static final String AllowFirstInstallmentPaid = 'AllowFirstInstallment__f';

@TestVisible
private GiftBatchSelector giftBatchSelector {
Expand Down
12 changes: 8 additions & 4 deletions force-app/main/default/lwc/geBatchWizard/geBatchWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from 'c/utilCommon';
import GeLabelService from 'c/geLabelService';
import psPaymentGateway from '@salesforce/label/c.psPaymentGateway';
import geRD2FirstInstallmentPaid from '@salesforce/label/c.geRD2FirstInstallmentPaid';

import getAllFormTemplates from '@salesforce/apex/GE_GiftEntryController.getAllFormTemplates';
import getDonationMatchingValues from '@salesforce/apex/GE_GiftEntryController.getDonationMatchingValues';
Expand Down Expand Up @@ -132,8 +131,8 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
if (this.isEditMode && this._allowRecurringDonations) {
let batchLevelDefaults =
JSON.parse(this.dataImportBatchRecord.fields[DATA_IMPORT_BATCH_DEFAULTS_INFO.fieldApiName].value);
return batchLevelDefaults[geRD2FirstInstallmentPaid] ?
batchLevelDefaults[geRD2FirstInstallmentPaid].value :
return batchLevelDefaults['AllowFirstInstallment__f'] ?
batchLevelDefaults['AllowFirstInstallment__f'].value :
false;
}

Expand Down Expand Up @@ -460,11 +459,16 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
if (dataImportBatch.apiName === formElement.objectApiName) {
dataImportBatch.fields[formElement.fieldApiName] = formElement.value;
} else {
batchDefaults[formElement.label] = {
const fieldElementData = {
objectApiName: formElement.objectApiName,
fieldApiName: formElement.fieldApiName,
value: isNotEmpty(formElement.value) ? formElement.value : undefined
};
if (formElement.fieldApiName === 'AllowFirstInstallment__f'){
batchDefaults[formElement.fieldApiName] = fieldElementData;
} else {
batchDefaults[formElement.label] = fieldElementData;
}
}
}

Expand Down

0 comments on commit 320654f

Please sign in to comment.