title: Using afterSave with Parse Cloud Code
body: <p>I'm on day 3 of learning Cloud Code and have made minimal progress. I'm confused as to how the call process works. In Cloud Code, I need to use afterSave to query for a class, where key "sent" equals false, and for each recipient in recipients array, push a notification to each and set "sent" to true.</p>
  
  <p>I have the afterSave function saved in main.js, but every time I call it using <code>PFCloud.callFunctionInBackground()</code> I'm getting <code>[Error]: function not found (Code: 141, Version: 1.7.2)</code>. </p>
  
  <p>Here's my afterSave trigger:</p>
  
  <pre><code>Parse.Cloud.afterSave("Send", function(request) {
    query = new Parse.Query("Shares");
    query.get(request.object.get("share").id, {
      success: function(post) {
        console.success("Howdy");
      },
      error: function(error) {
        console.error("Got an error " + error.code + " : " + error.message);
      }
    });
  });
  </code></pre>
  
  <p>And here I'm calling the function in Swift:</p>
  
  <pre><code>PFCloud.callFunctionInBackground("Send", withParameters: nil) {
              (response: AnyObject?, error: NSError?) -&gt; Void in
              let result = response as? String
              println(result)
  
          }
  </code></pre>
  
  <p>If I'm calling the afterSave trigger inside a <code>saveInBackgroundWithBlock</code> closure, do I call it using <code>PFCloud.callFunctionInBackground</code>?</p>