Загрузка...

ServiceNow Business Rules from Zero to Advanced | Auto calculate Total Amount” part 26/100

Custom Table creation & apply on Business Rules


1️⃣ INTERVIEW QUESTION

“How do you automatically calculate a total amount in custom table when quantity and price are entered?

2️⃣ WHY THIS QUESTION IS IMPORTANT (GENERAL + REAL PROJECT VIEW)

Manual calculations cause human mistakes
Wrong totals lead to:
Billing issues
Customer complaints

In real projects:
Users should never calculate totals
System must handle calculations automatically

3️⃣ REQUIREMENT BROKEN INTO 3 SIMPLE STEPS

1️⃣ When a record is saved
2️⃣ Check whether Quantity and Price per Unit are filled
3️⃣ Multiply them and store the result in Total Amount

“If quantity is entered 10
AND price per unit is entered 50
then multiply them 10*50
and save the result in total amount.” 500
4️⃣ WHICH TYPE OF BUSINESS RULE IS USED?

Table u_amma_organics_order
When Before
Action Insert + Update
Runs On Server-side
Why Before Business Rule?

Executes before record is saved

5️⃣ ALTERNATIVE METHODS
Method Why Not Recommended
Client Script UI only, not secure
UI Policy No server validation
Flow Designer Overkill for calculation
Script Include Not needed

👉 BEST & RECOMMENDED: Business Rule


..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.

Видео ServiceNow Business Rules from Zero to Advanced | Auto calculate Total Amount” part 26/100 канала Service now learn easy by Praveen Amirineni
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять