Automatically filled

Shir Sharvit
Tera Contributor

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

6 REPLIES 6

It still doesn't work for me.
The service offering field name is service_offering

Hi @Shir Sharvit 

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