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

Emmanuel Delez
Tera Expert

Hi Remy,


We can review your issue next week togheter? (September the 2th) in Versoix.


Emmanuel


Sure   !


Hi, Remy,


Sorry but I have forgot this subject last Tuesday.


See next Tuesday, I added a reminder in my agenda


Regards,


Emmanuel


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;


}