Getting below highlighted errors on Portal,please provide valuable suggestion to resolve the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 04:58 AM
Hi All,
I got a bug where on portal the below error message is displayed on portal when we open the portal, please suggest how to resolve this issue.
As I'm new to portal development please help me with the approach.
Server Script written on Widget:
(function () {
data.ACTION_TODO_COUNT = 'update_todo_count';
data.ACTION_LOAD_CASES = 'load_cases';
data.isMobile = gs.isMobile();
data.isVAActive = new GlidePluginManager().isActive("com.glide.cs.chatbot");
data.chatSupportEnabled = new sn_hr_sp.hr_PortalUtil().isChatSupportEnabled();
//Load To-dos count
if (!input || input.action == data.ACTION_TODO_COUNT) {
var myTodosCountObject= new sn_hr_sp.todoPageUtils().getMyTodosCount();
data.todoCount = myTodosCountObject.todoCount;
data.todoCountLabel = gs.getMessage("{0} to-dos remaining");
data.recordWatchers = myTodosCountObject.recordWatchers;
// avoid consecutive calls
if(input)
return ;
}
data.isHrCoreActive = GlidePluginManager().isActive("com.sn_hr_core");
if (data.isHrCoreActive && gs.getProperty('sn_hr_core.esc.create_hrprofile.override', 'true') === "true") {
// HR Profile
var hrProfileGr = new GlideRecord('sn_hr_core_profile');
hrProfileGr.addQuery('user', gs.getUserID());
hrProfileGr.setLimit(1);
hrProfileGr.query();
if (!hrProfileGr.hasNext() && gs.getUserID() && new GlideRecord('sys_user').get(gs.getUserID())) {
hrProfileGr.setValue('user', gs.getUserID());
hrProfileGr.insert();
}
}
// populate the 'data' object
data.link = '?id=hri_user_profile&sys_id='+ gs.getUserID();
// Defines the support queue ID that will be linked to by the Live Chat link in header
data.login_page = $sp.getValue('login_page');
var menu = $sp.getValue("sp_rectangle_menu");
//Initialize menu objects
data.sub = {};
data.top = {};
data.sub.menu = $sp.getWidgetFromInstance(menu);
//Copy sub menu to top menu, we want cart up top and menu items in the sub nav
data.top.menu = JSON.parse(JSON.stringify(data.sub.menu));
if (data.sub.menu && data.sub.menu.data) {
data.sub.menu.data.replace = true;
// Hide login if menu already has link to login
data.hasLogin = false;
if (data.sub.menu.data.menu.items) {
for(var i in data.sub.menu.data.menu.items) {
var item = data.sub.menu.data.menu.items[i];
if (item.type == 'page' && item.sp_page == data.login_page)
data.hasLogin = true;
}
}
}
var configOptions = JSON.parse(data.top.menu.options.widget_parameters);
data.hideSearchOnHomepage = configOptions.exclude_search_on_homepage.value;
if (data.hideSearchOnHomepage) {
data.homepage = $sp.getValue('homepage');
var gr = new GlideRecord('sp_page');
gr.get(data.homepage);
data.dashboardSuffix = gr.getValue("id");
data.portalSuffix = $sp.getPortalRecord().getDisplayValue("url_suffix");
}
// Analytics
data.analyticsSupportEnabled = new GlidePluginManager().isActive('com.sn_content_analytics') && new GlidePluginManager().isActive('com.sn_content_delivery') && !sn_cd.cd_ContentDelivery.isContentPreview($sp);
//Clean up items that don't belong
data.sub.menu.data.cartWidget = {};
data.sub.menu.options.enable_cart = false;
data.sub.menu.data.showTours = false;
data.top.menu.data.menu.items = [];
data.loginWidget = $sp.getWidgetFromInstance('login-modal');
var typeAheadOptions = {};
typeAheadOptions.refresh_page_on_search_submission = false;
typeAheadOptions.title = gs.getMessage("Search the portal");
if($sp.isAISearchEnabled())
typeAheadOptions.disable_all_suggestions = ($sp.getParameter('disableAllSuggestions') == 'true');
data.typeahead = $sp.getWidget('typeahead-search', typeAheadOptions);
data.avatarDropDown = $sp.getWidget('profile-with-drop-down',{"profile_url": data.link, "show_xs_avatar": false});
})();
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:26 AM
Hello Mohith,
Apologies, i didn't get what( write your Additional options) you're trying to say exactly.
Thanks,
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:34 AM
Hello Ram,
What i meant was open your portal record which is employee center in portals table by navigating like below
Portals --> Employee Center
and then once the portal record is open -->Open the record tagged in main menu field
and you can find a field called additional option there please try pasting below code
{
"enable_cart":{
"displayValue":"false",
"value":false
},
"auto_update_cart":{
"displayValue":"true",
"value":true
},
"exclude_search_on_homepage":{
"displayValue":"true",
"value":true
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:39 AM
Thanks for the reply,i have updated the code accordingly and now getting the error displayed below,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:59 AM
Hello image is broke can you re-attach