Radio button default value based on user form field

Jahnavi7
Mega Contributor

Hi,

I have a requirement that

Created a Field type: Radio Buttons on Order guide
Options: a)IG

b)AG, SDG

Default value: In user  form I have a field called group If group is AG my default value should AG

if group is SDG or AG my default value should be AG,SDG

I don't know how to get user table data in default value .can anyone help me.

Thank you,

11 REPLIES 11

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can start with something like this in a catalog client script on order guide

    var ref = g_form.getReference('<user field>', user);
    function location(ref) {
        alert("data test " + ref.<user data field>);
        //populate your radio button here
    }
-Anurag

Hi Anurag,

Thanks for your reply,

but In catalog client script there is no option like we can write code for particular table(order guide).so, I created on normal client script even though it is not working on any order guide.find_real_file.png 

In this case you need Glide Ajax to get the value form the table

Read this

 

https://docs.servicenow.com/bundle/paris-application-development/page/script/ajax/topic/p_AJAX.html

-Anurag

Hi Anurag,

I will try Glide Ajax or Scratchpad to get data.

where I'm facing a problem is when I get operating value I need to check with radio button here I can't able to get order guide value.

table:sc_cat_item_guide

type:onload

 

if ((g_form.getValue('name') == 'order_guide_sys_id')) {
alert(hello);

Here atleat I'm trying to show alert message