Загрузка...

“ServiceNow Business Rules Explained | Real-Time Examples, Best Practices” part17/100

BusinessRules

(Server side Logic...Runs When record is Inserted,updated,deleted or quiries...Works for UI,API,Import sets,Database level)

1.Interview question:

"Once an Incident is assigned to a group, how do you prevent users from changing the Assignment Group again?"

2.Why this Question is important?
-Prevent ticket modifications
-Ownership clarity
-Audit requirement
-Very common in enterprises


3.Break the Requirement:
1.Incident already had assignment group if (!previous.assignment_group.nil()) {
2.User tries to change it if (current.assignment_group != previous.assignment_group) {
3.System must block change current.setAbortAction(true);
4.Show proper error message gs.addErrorMessage('Assignment group cannot be changed once assigned.');

4.Types of Business Rules:

  1.Before : Before the record is saved to the database.

  Make fields mandatory, prevent update, change values before save, Stop duplicate records
  prevent priority downgrade, prevent reopening resolved incident.

  2.After : after
  To trigger actions, To create/update other records, To send notifications,
Changing record after update
 
  3.Aync : after database commit
  Improve performance, heavy logic, long-running scripts, large data updates,
  External integrations, Bulk notifications

  4.Display: when the form is loaded.
  control UI behaviour, pass data to client(g_scratchpad),show warnings, Display VIP banner.


(function executeRule(current, previous /*null when async*/ ) {

if (!previous.assignment_group.nil()) {
if (current.assignment_group != previous.assignment_group) {
gs.addErrorMessage('Assignment group cannot be changed once assigned.');
current.setAbortAction(true);
}
}

})(current, previous);

Видео “ServiceNow Business Rules Explained | Real-Time Examples, Best Practices” part17/100 канала Service now learn easy by Praveen Amirineni
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять