Skip to main content

Function: MnOnLookupTagClick

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

Decorator that marks a method as an event handler for lookup tag click event. This event is fired when a lookup tag is clicked.

Remarks

Available on pages: Record only.

Registration: Automatic registration at runtime.

For more information, see Microsoft Client API Reference

Example

Prevent save if the tag name of the primary contact starts with A

@MnComponent({
scope: {
pageType: "record",
table: "account"
}
})
export class PreventSaveOfContactStartingWithAComponent {
@MnOnLookupTagClick("primarycontactid")
onLookupTagClick(eventArg: FormEventArg) {
const args = eventArg.eventCtx.getEventArgs();
// Prevent save if the tag name starts with A
if (args.getTagValue()?.name?.startWith("A") {
args.preventDefault();
}
}
}

Parameters​

NameTypeDescription
controlNameValueOrConfigPropertyMapper<string>Name of the lookup control or callback function that returns the name of the lookup 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:455