script not working

Rosy14
Tera Guru
Here I have a list collector type variable. I am getting the values and storing in list. I mentioned below which are not working. Can you help?
 
var conList = [];
    var accList = g_form.getValue('select_buying_agent_account');
    var acc = accList.split(',');
    flag = 0;
    var gr;
    for (var i = 0; i < acc.length; i++) {
       
        gr = new GlideRecord('customer_account');
        gr.query("sys_id",acc[i]); //NOT working
        gr.query();
        g_form.addInfoMessage("test");
        while (gr.next()) {
           g_form.addInfoMessage(gr.name); //Not working
            conList.push(gr.name);
        }

    }
9 REPLIES 9

Tried, Same issue.

Can you show what you tried. Copy and paste the script.

-Anurag

Is this solved?

-Anurag

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Rosy14 ,

 

Can u check in ur customer table with the sys id coming in this info message 

if the record exist or not

acc[i]

 

Thanks,

Danish

 

 

 

AshishKM
Kilo Patron
Kilo Patron

Hi @Rosy14 , 

Try with toString() method in the latest code. 

 

var accList = g_form.getValue('select_buying_agent_account').toString();

 

-Thanks


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution