$scope.page.g_form or $scope.page.field is not working in service portal

sathis1994
Tera Contributor

Hi All,

I'm need to get the value of a variable user in widget scripting and populate it in custom widget field.

But i'm unable to use $scope.page.g_form.getValue('user')  or $scope.page.field.getValue('user') it returns an error message

TypeError: Cannot read property 'getValue' of undefined 

Kindly suggest any way to get the variable value in widget script

1 ACCEPTED SOLUTION

Swathi12
Tera Expert

Hi,

To get any values from any table , query the table in server script of the widget and store the values in data.testObj(if its only value you need) else save it in array of objects for example:

var items = [];

gliderecord query

in while loop(gr.next())

var item={};

item.sys+id= gr.getValue('sys_id')

 

Now, in client script you can get the values in $scope.data way.

 

Please refer the oob widgets for example SC Order Guide.

 

Mark this helpful/correct if it helped you.

 

Regards,

swathi

View solution in original post

1 REPLY 1

Swathi12
Tera Expert

Hi,

To get any values from any table , query the table in server script of the widget and store the values in data.testObj(if its only value you need) else save it in array of objects for example:

var items = [];

gliderecord query

in while loop(gr.next())

var item={};

item.sys+id= gr.getValue('sys_id')

 

Now, in client script you can get the values in $scope.data way.

 

Please refer the oob widgets for example SC Order Guide.

 

Mark this helpful/correct if it helped you.

 

Regards,

swathi