Automatically filled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 05:22 AM
Hi.
In the incident form,
if the "service" field is empty, should be filled in automatically when the "service offer" field is filled. If the "service" field is full - do not update it.
The value to be filled in the "service" field is the value in the "service offer" parent field (which is a reference to the record).
The record that is filled has a field called "parent" - this is the value that will enter the "service" field.
I need to solve this by using Client script include (GlideAjax).
In the past I have solved this by using getreference() with this code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var serv_offering = g_form.getReference('service_offering', setService);
}
function setService(serv_offering) {
var businessServiceValue = g_form.getValue('business_service');
if (!businessServiceValue) {
g_form.setValue('business_service', serv_offering.parent);
}
}
Thanks.Shir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 07:11 AM
It still doesn't work for me.
The service offering field name is service_offering
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 08:06 AM
Can you capture what you have done so far (the client script, script include)? So I can see what's going on.
Cheers,
Tai Vu