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
| Name | Type |
|---|---|
target | any |
key | any |
descriptor | PropertyDescriptor |
Returns
void