Skip to content

Instantly share code, notes, and snippets.

@furkankaracan
Created June 1, 2023 13:17
Show Gist options
  • Save furkankaracan/f5a38cc48ad25291319813ea0651c46c to your computer and use it in GitHub Desktop.
Save furkankaracan/f5a38cc48ad25291319813ea0651c46c to your computer and use it in GitHub Desktop.
phoneNotification: function (executionContext) {
let formContext = executionContext.getFormContext();
var phoneControl = formContext.getControl("telephone1");
var phoneNumber = formContext.getAttribute("telephone1").getValue();
var notification = {
messages: ["Copy phone number"],
notificationLevel: "RECOMMENDATION",
uniqueId: "phone_notification",
actions: [{
message: "Copy",
actions: [function () {
navigator.clipboard.writeText(phoneNumber);
phoneControl.clearNotification("phone_notification");
}]
}]
};
phoneControl.addNotification(notification);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment