service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 02:33 AM - edited 02-02-2024 06:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 08:03 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 09:06 PM
Can you Instruct me how to meet this requirement sir ?