{
alert(/Welcome2/);
var formContext = executionContext.getFormContext();
alert(Xrm.Page.getAttribute(/budgetamount/).getValue())
var nameKeyPressFunction = function () {
Xrm.Page.getControl(/budgetamount/).addOnKeyPress(nameKeyPressFunction);
}
import { IInputs, IOutputs } from "./generated/ManifestTypes";
export class CustomTextboxControl implements ComponentFramework.StandardControl<IInputs, IOutputs> {
private _inputElement: HTMLInputElement;
constructor(private context: ComponentFramework.Context<IInputs>, private notifyOutputChanged: () => void, private container: HTMLDivElement) {
// Create and append input element to the container
this._inputElement = document.createElement("input");
this._inputElement.setAttribute("type", "text");
this.container.appendChild(this._inputElement);
// Add keypress event listener
this._inputElement.addEventListener('keypress', this.handleKeyPress.bind(this));
}
public init(): void {
// Initialize your control
}
public updateView(context: ComponentFramework.Context<IInputs>): void {
// Update your control view
}
public getOutputs(): IOutputs {
// Return outputs
return {};
}
public destroy(): void {
// Cleanup code
this._inputElement.removeEventListener('keypress', this.handleKeyPress.bind(this));
}
private handleKeyPress(event: KeyboardEvent): void {
alert("test");
}
}
Deprecated Client API | Replacement Client API |
---|---|
addOnKeyPress | Use a custom control created using Power Apps component framework |
fireOnKeyPress | Use a custom control created using Power Apps component framework |
removeOnKeyPress | Use a custom control created using Power Apps component framework |
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156