Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Request Translation Ui Action

RadZz
Tera Contributor

Hello team,

 

We are currently working on localization framework and I get a error when I click " Request translations " button for knowledge article.

 

Everything is OOB and not sure why the button does not work.  

 

Code is : 

Ui action

 

onclick: renderLanguagePickerModal()

Condition:  new KBLFRequestTranslationUtil().canRequestTranslation('knowledge')

 

Script: 

function renderLanguagePickerModal() {
   // var sys_ids = g_list.getChecked();
    var sys_ids = '31ce32741b6e4e14b5375395604bcbc6';
    var msg = "";

    if (sys_ids.length == 0)
      msg = new GwtMessage().getMessage("You must select atleast one article.");
    else if (sys_ids.split(",").length > 200)
        msg = new GwtMessage().getMessage("You can translate maximum upto 200 articles.");
    else {
        var dlg = new GlideModal("kb_translation_language_picker");
        dlg.setTitle(getMessage("Request Translations"));
        dlg.setPreference("sys_id", sys_ids);
        dlg.setPreference("artifact_config_internal_name", "knowledge");
        dlg.setPreference("focusTrap", true);
        dlg.render();
    }

    if (msg.length == 0)
        return;

    var dialogClass = GlideModal ? GlideModal : GlideDialogWindow;
    var dialog = new dialogClass('glide_warn');
    dialog.setTitle(getMessage('Warning'));
    dialog.setPreference('title', msg);
    dialog.setWidth(350);
    dialog.render();
}

 

error is: g_List is not defined and if I hard code that line with : 

    var sys_ids = '31ce32741b6e4e14b5375395604bcbc6';
instead of : 

@Ankur Bawiskar 

0 REPLIES 0