title: Accessing exported function of a service from the same service in SailsJS
body: <p>I have exported a service as getProdDetailsBatch and another as createNewCartMysql in the same file MySQLService.js. Below is the definition for the same.</p>
  
  <pre><code>exports.getProdDetailsBatch = function(prod_list, city_id){
     var defer = sails.Q.defer();
  //Process Request
     return defer.promise;
  }
  
  
  exports.createNewCartMysql = function(product_id, qty, cart_type_id, member_id, visitor_id, city_id){
     var defer = sails.Q.defer();
  //Process Request
  
     getProdDetailsBatch([], 1).then(function(){
  
     })
  
     return defer.promise;
  }
  </code></pre>
  
  <p>While I am able to use the service getProdDetailsBatch from all other services in different file as well as from the controllers, but not createNewCartMysql which has been defined in the same file.</p>
  
  <p>Would someone have an idea as how to access the same.</p>