Hi, I need to prevent a user from manual case creation for a certain type of account.
The condition is: If Account field equals Internal, pop an error message preventing user from creating the case.
Can you help share solution or the process on how can I do this?
function testfunc(executionContext) {
// get form context
var formContext = executionContext.getFormContext();
// replace 'title' with the logical name of your field
var testfield = formContext.getAttribute("title");
if (testfield != null) {
var testFieldValue = testfield.getValue();
if (testFieldValue == 'TTT') {
executionContext.getEventArgs().preventDefault();
// show error message
alert('Error: Cannot create case for Internal account.');
}
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156