Auto-Populate Description field of Incident Record form, if Priority is 1 or 2

Sam196
Kilo Expert

I am new to client scripts, so if someone can provide a step-by-step answer it would be very helpful for me. Thanks in advance.

Problem: If the agent/caller selects "Priority 1 or Priority 2," the "Description" field needs to dynamically change from an empty box to:

[

Name: 

Number:

system:

Headingxx:

Heading88x:

]

Even better if these dynamic texts are bolded, so the caller entered content is regular text (not bolded). This would make it easier for incident handlers to read through. Again, a step-step explanation is much appreciated. Thank you!

 

find_real_file.png

1 ACCEPTED SOLUTION

Sam196
Kilo Expert

Thank you all for the tips and suggestions. This is what I did, and it is working fine. I don't think I can make the text bold since my description field is Type: String. (scratched out in red is just the text and I used the \n to separate the lines)

 

find_real_file.png

View solution in original post

5 REPLIES 5

Prasad Pagar
Mega Sage

Hi Sam,

You can create OnChange Client script which should work on Field as 'Priority'

In code you can use if(newValue == '1' || newValue == '2'){g_form.setValue('Your Description');}

Hope this helps

Thank you
Prasad

 

Hi Prasad - Thank you for the quick reply! However, I have that much in my code too, but issue I am having is I am not sure how to make the texts appear in the box. To be honest, I never really done client scripts, so I am lost.

Murthy Ch
Giga Sage

Hi Sam,

Try creating client script as Prasad suggested.

It will be helpful for you learning as well.

Post here if you see any challenge.

create onchange() client script on priority field and select the table on which table you want to run this.

Then use the above logic.

 

Thanks 

Murthy

 

 

 

 

 

Thanks,
Murthy

Sam196
Kilo Expert

Thank you all for the tips and suggestions. This is what I did, and it is working fine. I don't think I can make the text bold since my description field is Type: String. (scratched out in red is just the text and I used the \n to separate the lines)

 

find_real_file.png