Skip to content

Commit

Permalink
Merge pull request #20662 from frappe/mergify/bp/version-14/pr-20660
Browse files Browse the repository at this point in the history
fix: update property if field exists (#20658)
  • Loading branch information
deepeshgarg007 committed Apr 12, 2023
2 parents be4c28e + a2f637b commit 6c6f4c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frappe/public/js/frappe/form/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,10 @@ export default class Grid {
this.docfields.find((d) => d.fieldname === fieldname)[property] = value;

if (this.user_defined_columns && this.user_defined_columns.length > 0) {
this.user_defined_columns.find((d) => d.fieldname === fieldname)[property] = value;
let field = this.user_defined_columns.find((d) => d.fieldname === fieldname);
if (field && Object.keys(field).includes(property)) {
field[property] = value;
}
}

this.debounced_refresh();
Expand Down

0 comments on commit 6c6f4c7

Please sign in to comment.