choice table on a custom table

rems
Mega Expert

Hi guys !

 

I'm facing an issue today with choice list   :

I plan to use a choice list with the choice table field and a ref qual for filtering infos.

but the table I need to use in the "choice table" field of the dictionnary attribute is a custom one = u_test

and unfortunately this table is not available in the   list !!

seams that not custom table are available for the choice table field

 

any one already facing this   ?

1 ACCEPTED SOLUTION

Emmanuel Delez
Tera Expert

You cannot use the field as choice list with an custom table.


I propose to you to create this field as reference to your custom table and as referece qual to have:


javascript:RccFilterBsUserImpact();


In our sandbox, in the incident you will found the user impact field.


Script Include


function RccFilterBsUserImpact(){


    var bs = current.u_business_service.toString();


    var cat = current.category.toString();


    var resFilter = '';


   


    if (bs && cat){


          var m2m = new GlideRecord('u_m2m_user_impacts_services');


          m2m.addQuery('u_cmdb_ci_service', bs);


          m2m.addQuery('u_bs_user_impact.u_category', cat);


          m2m.query();


          while(m2m.next()){


                // += concatenate all retreive information


                resFilter += (m2m.u_bs_user_impact.sys_id + ',');


          }


    }


  resFilter = 'sys_idIN' + resFilter;


  return resFilter;


}


View solution in original post

5 REPLIES 5

Hi Remy,



I had faced similar issue in my project. The problem here is not with the custome table. All the tables which has choice list fields will be visible in   "choice table" field of the dictionnary attribute. The choice list fields of that tables will be visible in "Choice field".