data lookup rules are not working on Change

rao_2017
Kilo Contributor

Data lookup rules which are set on the incident form in the Service Center are not working in service portal in On change

The changes are getting reflected only on On Submit

 

Can anyone help on this?

 

find_real_file.png

 

Thanks,,

 

 

5 REPLIES 5

Mohammed_Iqbal
Tera Guru

Hello,

 

Goto application navigator >>data lookup definations 

 

check in that for change table is present or not.

 

find_real_file.png

 

HOPE THIS HELPFUL!!!!! MARK CORRECT OR HELPFUL.

Thanks,
Mohammed Iqbal

rao_2017
Kilo Contributor

yes its is Done but no Luck:(

find_real_file.png

Mohammed_Iqbal
Tera Guru

Hey

 

There is a current problem for this:

Data Lookup definitions do not function in Service Portal

 

It is currently not clear what release this will be implemented.

 

The suggested workaround would be to use custom client script to meet the requirement until a fix is delivered.

to achieve this using  script create ui script  and write that code: and call it in on change client script :

 

UI Script:-

 

function calculate_priority()

{

var imp=g_form.getValue('impact');

var urg=g_form.getValue('urgency');

if(imp ==1 && urg ==1){

g_form.setValue('priority',1);

}

else if(imp==1 && urg==2){

g_form.setValue('priority',2);

}

else if(imp==1 && urg==3){

g_form.setValue('priority',3);

}

else if(imp==2 && urg==1){

g_form.setValue('priority',2);

}

else if(imp==2 && urg==2){

g_form.setValue('priority',3);

}

else if(imp==2 && urg==3){

g_form.setValue('priority',4);

}

else if(imp==3 && urg==1)

{

g_form.setValue('priority',3);

}

else if(imp==3 && urg==2)

{

g_form.setValue('priority',4);

}

else if(imp==3 && urg==3)

{

g_form.setValue('priority',5);

}

}

 

On chnage client script:- 

select field impact. and paste that code in script part

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

calculate_priority()

}

 

 

HOPE THIS HELPFUL!!!!! MARK CORRECT OR HELPFUL.

Thanks,
Mohammed Iqbal

 

rao_2017
Kilo Contributor

This looks fine and working good --- buts fails in one scenario while we change urgency (as every time impact cannot be the on change) field