title: Unable to retrieve _id after insert in a Meteor.method call
body: <p>I can't get the return value of the inserted _id using the answers that I found on the same question here like this;</p>
  
  <pre><code>Meteor.call('saveDocument', value1, value2, function(error, result){
   var theIdYouWant = result;
  });
  </code></pre>
  
  <p>and on the server;</p>
  
  <pre><code>saveDocument: function (value1, value2) {
    return MyCollection.insert({ 'value1': value1, 'valu2': value2}); 
  }
  </code></pre>
  
  <p>The answer was from May 2013 so I don't know if this is no loner the correct way error and result are always undefined. However I can get it to work by keeping it on the server like this;</p>
  
  <pre><code>    'transactionInsert': function(currentUserId, trx_num, other_stuff){
          trxId = trx.insert ({
              "userID": currentUserId,
              "trx_num": trx_num, 
              ... other stuff ...
          });
      },
      'insertInvoiceItem': function(currentUserId, invoiceNum){
          invoiceItems.insert(
              {"userID": currentUserId,
              "invoice_num": invoiceNum,
              "trx_id": trxId}            
          );
      }
  </code></pre>
  
  <p>From the client <code>insertInvoiceItem</code> is called immediately after <code>transactionInsert</code>. My question is will <code>trxId</code> always be the correct id of the transaction even if thousands of users are using this or can another users transaction cause the id to be incorrect?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I was wrong, still not working. Here is where I'm at now;</p>
  
  <pre><code>Meteor.call('transactionInsert', Meteor.userId(), trx_num, 
      function(error, result){
          console.log(Session.get("trxId")); // p2YrLTiypiMm4tKma appears AFTER undefined in the console
          Session.set("trxId",result);
      });
  console.log("trxId is " + Session.get("trxId")); // undefined
  Meteor.call('insertInvoiceItem', Meteor.userId(), invoiceNum, Session.get("trxId")
  
  Template.writeInvoice.helpers({  
      trxId: function() {
          return Session.get("trxId"); 
      }
  })
  </code></pre>
  
  <p>on the server;</p>
  
  <pre><code>Meteor.methods({
      'transactionInsert': function(currentUserId, trx_num){
          return trx.insert ({
              "userID": currentUserId,
              "trx_num": trx_num
          })
      },
      'insertInvoiceItem': function(currentUserId, invoiceNum, trxId){
          invoiceItems.insert(
              {"userID": currentUserId,
              "invoice_num": invoiceNum,
              "trx_id": trxId}
          )
      }
  })
  </code></pre>