Skip to main content

Function: MnOnPreProcessStatusChange

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

Decorator that marks a method as an event handler for pre-process status change event.

This event is fired when before the Business Process Flow status is changed.

Remarks

Available on pages: Record only.

Registration: Automatic registration at runtime.

For more information, see Microsoft Client API Reference

Example

Confirm business process flow termination

@MnComponent({
scope: {
pageType: "record",
table: "opportunity"
}
})
export class ConfirmBPFTerminationComponent {
@MnOnPreProcessStatusChange()
async onPreProcessStatusChange(eventArg: FormEventArg) {
const args = eventArg.eventCtx.getEventArgs();
const result = await Xrm.Navigation.openConfirmDialog({
text: "Are you sure you want to terminate the business process flow?"
});
if (!result.confirmed) {
args.preventDefault();
}
}
}

Returns

fn

▸ (target, key, descriptor): void

Parameters
NameType
targetany
keyany
descriptorPropertyDescriptor
Returns

void

Defined in

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