need help on widget customization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 01:08 AM
Hi everyone,
We need to develop a 'My Account Team' page within the CSM Portal, allowing customers to access their account information and contacts. I've developed a custom widget for this task, but it's not performing as intended.
Please provide guidance on troubleshooting and fixing the issues with my current widget, or suggest an alternative widget that I can duplicate and implement.
- Labels:
-
Customer Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 05:34 AM
Hi,
Please share script in the for of text (or use script editor), it is difficult to suggest changes on screenshot. Also, share client script part of widget.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 01:14 AM
Hello Anil,
Thank you for your prompt response. Here's the HTML and server script for the widget customization:
HTML:
<div class="account-info-widget">
<h2>My Account</h2>
<p>Name: {{c.data.account.name}}</p>
<p>Category: {{c.data.account.category}}</p>
</div>
<div ng-if="loading">
Loading account information...
</div>
<div ng-if="error">
Error loading account information.
</div>
Server Script:
(function() {
var userId = gs.getUser().getID();
var grn = new GlideRecord('customer_contact');
grn.addQuery('sys_id', userId);
grn.query();
if (grn.next()) {
var account = grn.accountDYNAMIC4835748687ab2d103fa3c8c4dabb351b;
var gr = new GlideRecord('customer_account');
gr.addQuery('name', account);
gr.query();
if (gr.next()) {
data.account = {
name: gr.getValue('name'),
category: gr.getValue('rank_tier')
};
} else {
gs.error('No matching records found in customer_account table');
}
} else {
gs.error('No matching records found in customer_contact table for the current user');
}
})();
I appreciate any insights or suggestions you can provide to enhance the functionality.
Thank you ,
Irfan Habeeb.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 05:37 AM
Can you please share Client script as well?
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 11:37 PM
Hi Anil,
We figured it out .
Thank you for your help so far .