Skip to content

Commit

Permalink
fix: set optionset value to null
Browse files Browse the repository at this point in the history
- fixed Value setter to allow setting optionsets to null using Value property
  • Loading branch information
AhashSritharan committed Nov 13, 2024
1 parent e1be0c0 commit 589189d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions build/src/XrmEx.js

Large diffs are not rendered by default.

Binary file modified release/xrm-ex.zip
Binary file not shown.
4 changes: 3 additions & 1 deletion src/XrmEx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,8 @@ export namespace XrmEx {
return this.Attribute.getValue();
}
set Value(value: (keyof Options)[] | number[]) {
if (Array.isArray(value)) {
if (value === null) this.Attribute.setValue(null);
else if (Array.isArray(value)) {
let values = [];
value.forEach((v) => {
if (typeof v == "number") values.push(v);
Expand Down Expand Up @@ -1793,6 +1794,7 @@ export namespace XrmEx {
}
set Value(value: keyof Options | number) {
if (typeof value == "number") this.Attribute.setValue(value);
else if (value === null) this.Attribute.setValue(null);
else this.Attribute.setValue(this.Option[value]);
}
/**
Expand Down
8 changes: 6 additions & 2 deletions testBuild/src/XrmEx.js

Large diffs are not rendered by default.

0 comments on commit 589189d

Please sign in to comment.