Service Portal Widget: how to get sys_id ?

stryker129
Mega Guru

Hi guys,

In my custom Customer table how can I get sys_id for each record?

var gr = new GlideRecord("x_11111_notes_customers");

gr.addActiveQuery();

gr.orderByDesc('sys_updated_on');

gr.query();

data.customers = [];

while(gr.next()){

      var customer = {};

      customer.id = gr.sys_id;

      customer.name = gr.getDisplayValue('name');

      data.customers.push(customer);

}

This code in line #10 returns nothing.

Where I am wrong?

Thanks

1 ACCEPTED SOLUTION

No on service portal gr.getDisplayValue("sys_id"), it only works.


customer.id = gr.sys_id+'' and customer.id = gr.getValue('sys_id') all are not working.


View solution in original post

10 REPLIES 10

I need it for editing specific customer in custom Service Portal page form.