Skip to main content

Function: MnOnFormLoad

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

Decorator that marks a method as an event handler for form load event.

This event is fired when the form is loaded.

Remarks

Available on pages: Record only.

Registration: Manual registration only. Register this event in the Form Properties of the form editor.

This event must be registered to initialize Primno on a record page.

For more information, see Microsoft Client API Reference

Example

Form Load

@MnComponent({
scope: {
pageType: "record",
table: "account"
}
})
export class MyComponent {
@MnOnFormLoad()
onFormLoad() {
Xrm.Navigation.openAlertDialog({ text: "Form loaded" });
}
}

Returns

fn

▸ (target, key, descriptor): void

Parameters
NameType
targetany
keyany
descriptorPropertyDescriptor
Returns

void

Defined in

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