Skip to main content

Function: MnOnOutputChange

MnOnOutputChange(controlName): (target: any, key: any, descriptor: PropertyDescriptor) => void

Decorator that marks a method as an event handler for an output change event.

This event is fired when the output value of a control is changed. Call getOutputs() on the control to get the output value.

Remarks

Available on pages: Record only.

Registration: Manual registration only.

For more information, see Microsoft Client API Reference

Example

Show the output value of a control

@MnComponent({
scope: {
pageType: "record",
table: "account"
}
})
export class ShowOutputValueComponent {
@MnOnOutputChange("myControl")
onOutputChange(eventArg: FormEventArg) {
const control = eventArg.formCtx.getControl("myControl");
const outputValue = control.getOutputs();
Xrm.Navigation.openAlertDialog({ text: `Output value changed: ${JSON.stringify(outputValue)}` });
}
}

Parameters

NameTypeDescription
controlNameValueOrConfigPropertyMapper<string>Name of the control or callback function that returns the name of the control from the component configuration.

Returns

fn

▸ (target, key, descriptor): void

Parameters
NameType
targetany
keyany
descriptorPropertyDescriptor
Returns

void

Defined in

packages/core/src/core/metadata/events.ts:406