GwtMessage Functionality
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015 05:07 AM
Can anyone explain me the functionality of "GwtMessage"?
- 11,250 Views
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Check this KB: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB3222107
Resolution
## Solutions
**Option A — UI Type: Desktop (quick fix)**
- Change script's UI Type from "All" to "Desktop"
**Option B — Rewrite for SP compatibility (lasting fix)**
- Replace `GwtMessage` → `getMessage()` (callback-based)
- Replace `document.getElementById()` → `g_form.getElement()`
- Use feature detection to branch on runtime:
```javascript
if (typeof GwtMessage !== 'undefined') {
// Classic path
} else if (typeof g_form !== 'undefined') {
// Service Portal path
}
```
**Option C — Apply official patch**
- Check for published Update Set from product team