Skip to content

Make trigger context accessible in save #6459

Closed
@mtrezza

Description

@mtrezza

Is your feature request related to a problem? Please describe.
Sometimes an object should be saved with custom execution in its triggers (e.g. afterSave).

Describe the solution you'd like
It should be possible to pass arguments from the save call to the triggers. There is already a context object that is passed from beforeSave to afterSave. It would be practical to make the context accessible in the save call as an option, e.g.:

object.save(null, {context: {myArg: true}});

Parse.Cloud.beforeSave('MyClass', req => {
    let myArg = req.context.myArg;
});

TODOs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions