Wednesday, March 28, 2012

profileservice newbie question

Do the callbacks return before the Sys.Services.ProfileService.save() returns ?

Sys.Services.ProfileService.save(['myProperty'], onSaveCompleted, onProfileServiceFailed,null);

In otherwords, when Sys.Services.ProfileService.save() returns, can I assume the property is saved (barring no error occured)? or do I specifically need to wait for onSaveCompleted()

Since this is an asynchronous call, Sys.Services.ProfileService.save() will return immediatelybefore the save code on the server gets executed.

So you cannot assume that the property is saved before onSaveCompleted() is fired
because there could be errors on the server during processing in which case onProfileServiceFailed() will be fired.


Thanks! That is what I suspected but wanted confirmation.

No comments:

Post a Comment