From 8781442c82027f5aeb53fb3670c5f505d342b088 Mon Sep 17 00:00:00 2001 From: utsav-gargsh Date: Sun, 27 Apr 2025 10:58:47 +0530 Subject: [PATCH] Update sfpegRecordEditFlw.js for fixing bug - if we try to remove any value from the field then it doesnt include that field in new record list. Because the value returned is undefined so it doesnt include that field where value is being removed. So if user tries to remove lookup then it will not allow that. Solution: If its undefined then override it with null this way it will be automatically included in the newRecord List which in turn be returned to output then that can be updated later. --- .../main/default/lwc/sfpegRecordEditFlw/sfpegRecordEditFlw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/lwc/sfpegRecordEditFlw/sfpegRecordEditFlw.js b/force-app/main/default/lwc/sfpegRecordEditFlw/sfpegRecordEditFlw.js index 471849b..fee324f 100755 --- a/force-app/main/default/lwc/sfpegRecordEditFlw/sfpegRecordEditFlw.js +++ b/force-app/main/default/lwc/sfpegRecordEditFlw/sfpegRecordEditFlw.js @@ -161,7 +161,7 @@ export default class SfpegRecordEditFlw extends LightningElement { this.lastModif = fieldName + ' from ' + oldValue + ' to ' + newValue; if (this.isDebug) console.log('handleChange: lastModif tracked ', this.lastModif); - this.newRecord[fieldName] = newValue; + this.newRecord[fieldName] = newValue?newValue:null; if (this.isDebug) console.log('handleChange: newRecord updated', this.newRecord[fieldName]); if (this.isDebug) console.log('handleChange: newRecord updated', JSON.stringify(this.newRecord)); @@ -192,4 +192,4 @@ export default class SfpegRecordEditFlw extends LightningElement { if (this.isDebug) console.log('handleCancel: END'); } -} \ No newline at end of file +}