code: function findCollectionName(entityName) {
      var xrmInternal = Utility.getXrmInternal();
      if (!Utility.isNull(xrmInternal)) {
          return xrmInternal.getEntitySetName(entityName) || entityName;
      }
  
      var collectionName = null;
  
      if (!Utility.isNull(_entityNames)) {
          collectionName = _entityNames[entityName];
          if (Utility.isNull(collectionName)) {
              for (var key in _entityNames) {
                  if (_entityNames[key] == entityName) {
                      return entityName;
                  }
              }
          }
      }
  
      return collectionName;
  }
docs: Searches for a collection name by provided entity name in a cached entity metadata.
  The returned collection name can be null.
  
  @param {string} entityName - entity name
  @returns {string} - a collection name