getMessage in UI page not working

keepintouch_kir
Giga Contributor

HI Administration All,

I have modified OOB UI page "assessment_take2" as per user requirement. This was for adding custom translations for a message. Code is like below :

<j2:if test="$[GlideMobileExtensions.getDeviceType() == 'doctype']">

  <div class="notification notification-info">

  <j2:if test ="${task_table=='Incident'}">

       

                                                                        $[gs.getMessage('incident_survey_msg')]

            </j2:if>

  <a onClick="openTaskOverlay(event)" class="related-task-link">${gs.getMessage('${task_record}')}</a>

  <button data-dismiss="alert" class="btn btn-icon close icon-cross">

  <span class="sr-only">Close</span>

  </button>

  </div>

  </j2:if>

The above getMessage is not working for other languages except English after adding the   <j2:if test ="${task_table=='Incident'}"> condition. For english, message is showing up. I have added translations already in messgae table but it is not working Any help is highly appreciated!

11 REPLIES 11

Hi Sri Varts,



Can you provide additional details? What is the user language preference? & are you using the OOB assessment_take2 UI page?



Many Thanks,


Kiran


keepintouch_kir
Giga Contributor

Hi All,



Thank you so much for the support! My issue is now resolved. Messages are coming for different languages.



Issue is not with the if condition but with the task_table. Initially, it is storing "Table Display Value".


task_table=getClassDisplayValue();


<j2:if test ="$[task_table=='incident']">



When language is English, Display value is "Incident". Hence it was going into if loop & picking up. But when language is changed (EG: German) display value is changed to "Vorfall" As it is not matching, it is not going inside the loop & message is not picked up.


Now I updated it to "task_table = tr.getTableName();" It fetches the table name "incident" always & it's working perfectly