PrashantLearnIT
Tera Sage

Did you know that you can access parameters passed to UI page inside UI page client script directly?

 

Example:

UI Action to invoke UI page:

    var gdw = new GlideModal('validate_ui_page'); // name of UI page
    gdw.setSize(750,300);
    gdw.setPreference('sysparm_tableName', g_form.getTableName());
    gdw.render();

UI Page Client Script:

    var myModal = GlideModal.prototype.get('validate_ui_page'); // pass name of the UI page for global scope and for scoped app pass the endpoint name without .do extension
    var tableName = myModal.getPreference('sysparm_tableName'); // pass name of the parameter mentioned in setPreference() method

 

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

 

Best Regards,

Prashant Kumar (LearnIT)

 

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635