Displaying an SLA value in an info message from a reference field

Tal5
Giga Guru

Hello everyone,

 

I would like to display the relevant value from the SLA duration field in an informational message when a new case is opened.

In the record producer, I have a variable set that includes a variable created in a catalog client script named "add SLA alert." This script is of type onSubmit and contains the following code:

 

JavaScript
g_form.addInfoMessage("XXXXXX " + g_form.getValue('?') + " DAYS");

My challenge lies in determining the appropriate value to use within g_form.getValue('?').

Could anyone provide guidance on this matter?

 

Thank you in advance.

Best regards

Tal

 

 

1 ACCEPTED SOLUTION

Tal5
Giga Guru

So after a few days of research,
I found this to be the best solution.

I am sharing it for everyone to have.

 

We will display the value in the message by creating a BR
after (insert)
on the sn_hr_core_case table

Tal5_0-1732782873248.png

in advanced section we will write the following script

gs.addInfoMessage("Your request has been successfully opened and forwarded to the team handling the individual service center. Your request will be processed within + current.hr_service.u_sla_duration + "hours" "
 

View solution in original post

3 REPLIES 3

Kieran Anson
Kilo Patron

The SLA won't be attached until after creation of the generated record. You won't be able to fetch this value in an onSubmit script unless you're pre-determining what SLA(s) are going to attach.

 

What's the business problem trying to be solved? There may be a better solution

Tal5
Giga Guru

@Kieran Anson thanks for your quick answer.

 

Each record producer is assigned a specific task, and each task has a predefined SLA duration.

If this is what you intended, I would like to display the SLA value, such as 72 hours.

The business requirement is that the customer wants the user to see the number of hours or days allocated to handle their task in the information message.

 

Tal5
Giga Guru

So after a few days of research,
I found this to be the best solution.

I am sharing it for everyone to have.

 

We will display the value in the message by creating a BR
after (insert)
on the sn_hr_core_case table

Tal5_0-1732782873248.png

in advanced section we will write the following script

gs.addInfoMessage("Your request has been successfully opened and forwarded to the team handling the individual service center. Your request will be processed within + current.hr_service.u_sla_duration + "hours" "