Skip to content

Commit 6e818e2

Browse files
authored
🤖 Merge PR DefinitelyTyped#74636 [xrm] Add setVisible to FramedControl by @Mosh-K
1 parent dd9586b commit 6e818e2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

types/xrm/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3896,7 +3896,7 @@ declare namespace Xrm {
38963896
* @remarks An Iframe control provides additional methods, so use {@link IframeControl} where
38973897
* appropriate. Silverlight controls should use {@link SilverlightControl}.
38983898
*/
3899-
interface FramedControl extends Control {
3899+
interface FramedControl extends Control, UiCanSetVisibleElement {
39003900
/**
39013901
* Returns the content window that represents an IFRAME or web resource.
39023902
* @returns A promise that contains a content window instance representing an IFRAME or web resource.

types/xrm/xrm-tests.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,3 +785,14 @@ function getStepsFromActiveStage(formContext: Xrm.FormContext) {
785785
// $ExpectType ItemCollection<Step>
786786
const steps = process.getActiveStage().getSteps();
787787
}
788+
789+
// Demonstrate set visibility for framed control (webresource)
790+
const framedControlSetVisible = (formContext: Xrm.FormContext) => {
791+
const framedControl = formContext.getControl<Xrm.Controls.FramedControl>("myWebResource");
792+
if (framedControl === null) {
793+
return;
794+
}
795+
796+
// setVisible
797+
framedControl.setVisible(true);
798+
};

0 commit comments

Comments
 (0)