g_form.getParameter

maricielo
Tera Contributor

Hi,

I have this script:

if (g_form.getParameter("sysparm_id") == 'ad0c55bb0f665e809850ecd692050935')

{

  g_form.setValue("assignment_group", "US.Servicedesk.L1.NYBC");

}

In UI Fullfiller works but in Portal it doesn't work  

Any ideas?

Build name: Istanbul

Thanks a lot

5 REPLIES 5

ark6
Mega Guru

Unfortunately getParameter doesnot work in SP. Here's the wiki article



http://wiki.servicenow.com/index.php?title=Mobile_Client_GlideForm_(g_form)_Scripting#Do_Not_Use_Met...



By the way what is your requirement?


maricielo
Tera Contributor

Thanks for the quick response…


I have one script for different services


I need to assign static values depends of the service that I use… so I get the service with the sys_id and I fill the variables…




// Service A


if (g_form.getParameter("sysparm_id") == '85eeb4410ffe1e801668956f62050ed5') {


g_form.setValue("assignment_group", "Test A");


g_form.setValue("category", "Other");


g_form.setValue("u_subcategory_1", "Other");


g_form.setValue("u_subcategory_2", "Other");


}


// Service B


if (g_form.getParameter("sysparm_id") == 'dcb7fa5d0fb69e801668956f62050e64') {


if (g_form.getValue('request_type') == 'Equipment Request') {


g_form.setValue("assignment_group", "Test B");


g_form.setValue("category", "Workplace");


g_form.setValue("u_subcategory_1", "ClientHardware");




Maricela Ramí­rez Pérez


Systems Development Sr. Specialist


m +521 55 37482443 (BBPIN: 282F6F4A)


maricela.ramirez@atos.net<mailto:maricela.ramirez@atos.net>


Sevilla No. 40 Piso 3


Col. Juárez


Delegación Cuauhtémoc


06600, México, D.F.


www.atos.net<http://www.atos.net/>


P Protect the nature.


maricielo
Tera Contributor

Thanks a lot!