service portal

sanjeet1245
Tera Guru

 

 

 

 

 

 

 

 

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @sanjeet1245 

to be honest, your code doesn't make sense at all, but to answer your question.

In your code line

 incidentData[columnName] = incidentGR.getDisplayValue(columnName);

You try to get values from an Incident record, but the variable columnName contains a label and not the technical name. You can see this for the caller field. The following code

incidentGR.getDisplayValue('Caller');

cannot work. Instead, it has to be done with the technical name, which starts with a lower case letter:

incidentGR.getDisplayValue('caller');

Thats the reason why you get everywhere a NULL value. But even if you fix your code you cannot prevent NULL values. Therefore you have to optimize your code like

 incidentData[<FIX THIS>] = incidentGR.getDisplayValue(<FIX THIS>) || '';

The additional piece

|| ''

at the end makes sure that in case a NULL value is returned from the GlideRecord an empty string is used instead.

Maik

hi @Maik Skoddow 

Can you Instruct me how to meet this requirement sir ?