cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Got an error while creating Alert.

Highlighted
Aquamarine

Got an error while creating Alert.

Hi All,

I am trying to add alert to the property with a service.

Got an error like Error executing service test. Message :: Alert Type [Above] is not valid - See Script Error Log for more details. How to resolve this issue?

 

I followed same code mentioned here.

// Create the Attributes Infotable for AddOrUpdateAlert call
var params = {
	infoTableName: "alertAttr" /* STRING */
};
var attrs = Resources["InfoTableFunctions"].CreateInfoTable(params);

// Define the fields required by an Above type Alert for an INTEGER field (not the values!)

// limit - Minimum value at which the alert will trigger.
var field = new Object();
field.name = "limit";
field.baseType = 'INTEGER';
attrs.AddField(field);

// limitInclusive - Is the condition Greater than (>) or Greater than or equal (>=)?
field.name = "limitInclusive";
field.baseType = 'BOOLEAN';
attrs.AddField(field);

// Define the new Alert values and add the row to the table.
var row = new Object();
row.limit = 5;					// Alert will trigger when field >=5
row.limitInclusive = true;		// Alert includes 5
attrs.AddRow(row);

// Call the AddOrUpdateAlert Service
var params = {
	alertType: "Above" /* STRING */,
	alertName: "MyAlert" /* STRING */,
	property: "MyIntProperty" /* STRING */,
	attributes: attrs /* INFOTABLE */,
   	priority: 1 /* INTEGER */,
	persistent: true /* BOOLEAN */,
	enabled: true /* BOOLEAN */
};
me.AddOrUpdateAlert(params);

 

5 REPLIES 5

Re: Got an error while creating Alert.

Hello.

 

The code you pasted in is indeed the same as the example in the Help Center; what does the Script Error Log referenced by the error message say?

 

 

Thanks,

 

-- Craig A.

Re: Got an error while creating Alert.

Hi

May Be "MyIntProperty" on your thing either String or some other Base type

Re: Got an error while creating Alert.

Yes. I am replicating the same scenario. i am getting an error, Error executing service test. Message :: Alert Type [Above] is not valid - See Script Error Log for more details.

Re: Got an error while creating Alert.

Hello all,

 

We are also facing same issue in Thingworx 8.3.0 which is working fine in Thingworx 8.2

 

Regards,

VR

Re: Got an error while creating Alert.

Hi, all.

 

Is there anything in the Script Error Log that indicates what the problem might be?

 

Thanks,

 

-- Craig A.