steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service success event data parameter unreadable

I have a service which returns a "0" or "1" in the service response

In the service success event I have some javascript to show an alert depending on the response

The value of parameter data shows as [object Object]

If I test the service on the Test screen I get the response
{
"mysave":"0"
}

The response parameter set in the service is
$ array is ticked
mysave array is NOT ticked

any ideas

regards
Steve

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

service success event data parameter unreadable

What do you print in service's success event?

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service success event data parameter unreadable

Hi Max

The Service returns a string "0" or "1" in the service response parameter mysave

I just want to be able to read the response value in the success event and display in an alert
'Appointment Saved' or 'Appointment Save Failed' depending on whether the response parameter is "0" or "1"

At the moment the data parameter sent to the success event is [object Object]

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

service success event data parameter unreadable

What JavaScript do you run in the event?

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service success event data parameter unreadable

Hi Max

if (data.toString() == '0') {
alert('Appt Created');
}
else {
alert('Appt Creation Failed');
}

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

service success event data parameter unreadable

data is the entire response, so you should try data.mysave.

Return to “Issues”