I am trying to send a push to a user from Parse Cloud Code every time a new object is created of a certain class, but in the push i need to send the objectId to the user, but it is always null. So is the objectId available in beforeSave when a new object is created?
Asked
Active
Viewed 110 times
2 Answers
1
No, the objectId is not available until after the object is saved. However, there is an afterSave() method where you can send the push. Works the same way as beforeSave().

Jake T.
- 4,308
- 2
- 20
- 48
-
but i need to know if the object is new and the `isNew` method is only available in beforeSave – Miguel Carvajal Jan 20 '16 at 20:32
0
You should use the afterSave
trigger and check for
request.object.existed()
in there to run your code on new objects.

Ruben
- 1