Customer Portal

Get Involved. Join the Conversation.

Topic

    Kesava Kumar
    How to get Message base value
    Topic posted March 29, 2019 by Kesava KumarGold Medal: 3,500+ Points, last edited March 29, 2019 
    58 Views, 5 Comments
    Title:
    How to get Message base value
    Summary:
    How to get Message base value in JS file present in assets folder
    Content:

    Hi all,

    I am trying to fetch message base value in JS file which is present in assets/javascript folder, but not finding any such method.

    I have tried below one but throwing error stating RightNow not defined.

    RightNow.Interface.getMessage("MESSAGE_BASE_NAME")

    Anyone please let me know whether it can be done or not, if yes can please suggest what is the correct syntax to get it using message base name.

    Thanks & regards

    Kesava

     

    Version:
    CP 3.3

    Comment

     

    • Kesava Kumar

      Any ideas from anyone?

    • Sebastiaan Draaisma

      Hi Kesava

      If it's in a report you want this you could use msg_lookup(25040) where the integer is the messagebase entry id. If it's on the customer portal you need this you could use label_input="#rn:msg:SUBJECT_LBL# here you use the key name.

    • Kesava Kumar

      Hi Sebastiaan,

      Thanks for the reply, suggested method for customer portal #rn:msg:SUBJECT_LBL#  this works on customer portal pages/widgets/view files.

      But here I am trying to get the value in assets folder js file this is not working here, any alternative method is there? that will be helpful.

      Thanks & regards

      Kesava

    • Sebastiaan Draaisma

      Sorry for the late reply Kesava. The forum has an issue that prevents me from receiving updates when the thread gets updated :-)

      Unfortunately I'm no js expert but from what I understand (NOT ADVISED) is that you are able to pass a PHP var to a js file which may be able to do the trick for you or at least give you some ideas :-)

      https://stackoverflow.com/questions/3241422/include-php-inside-javascript-js-files

    • Rajan Davis

      You might need to create a custom widget with the functionality you are after (this will give you access to the Rightnow Object) 

      OR

      create a custom controller method that let's you retrieve the value via AJAX.