ConversionError: The undefined value has no properties.

shubham73
Kilo Contributor

I am getting this error "ConversionError: The undefined value has no properties."  when calling script include from UI action (not client callable).

Where am I doing wrong ? 

here is my UI action Script - 

var access_ID = current.u_credential.access_key;
var access_Key = current.u_credential.secret_key;
var region_name= current.u_region.name;
var utils = new DiscoverResourceUtils();
var result = utils.getResource(access_ID,access_Key,region_name);
current.update()
action.setRedirectURL(current);

 

and here is Script include - (client is unchecked)

var DiscoverResourceUtils = Class.create();
DiscoverResourceUtils.prototype = {
getResource : function(access_ID,access_Key,region_name) {
gs.info("in discoveryUtils");
try{
var creds ={};
creds.access_id = access_ID;
creds.access_key = access_Key;
creds.region = region_name

var r = new sn_ws.RESTMessageV2('AwsVmResources', 'AwsVMInstances');
gs.info("credential******* ",creds)
r.setRequestBody(creds);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.info(responseBody);
return "success";
}catch(err){
return "failed"
}
},

type: 'DiscoverResourceUtils'
};

 

Thanks and regards,

Shubham

4 REPLIES 4

BALAJI40
Mega Sage

Hi,

Hope all dot walk-in fields are exist on the form. If not, please recheck once.

If still issue persist, try to execute the above script in back ground and pass the static values and check what response you are receving.

var utils = new DiscoverResourceUtils().getResource('pass value access_id','pass access_Key','pass region_name');

 

gs.print(utils );

 

 

Hi BalajiReddy,

I have done like you said but it's throwing same error  "

Evaluator: org.mozilla.javascript.EcmaError: The undefined value has no properties.
   Caused by error in script at line 4

"

I have checked with dot walking values, there are accessible and able to log them.

I think here is problem with script include. what can be done?

 

 

Thanks and regards,

shubham

Try to define your object in this format,

 

var creds ={
'access_id': access_ID,
'access_key' : access_Key,
'region' : region_name

};

It got resolved by making script include client callable.

thanks for help though...