> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFStatisticsCreateStatisticDefinitionAsync

> Crée une nouvelle définition de statistique d'entité.

Crée une nouvelle définition de statistique d'entité.

## Syntaxe

```cpp theme={null}
HRESULT PFStatisticsCreateStatisticDefinitionAsync(  
    PFEntityHandle entityHandle,  
    const PFStatisticsCreateStatisticDefinitionRequest* request,  
    XAsyncBlock* async  
)  
```

### Paramètres

**`entityHandle`**   PFEntityHandle

PFEntityHandle à utiliser pour l'authentification.

**`request`**   [PFStatisticsCreateStatisticDefinitionRequest\*](/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticscreatestatisticdefinitionrequest)

Objet de requête renseigné.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock pour l'opération asynchrone.

### Valeur de retour

Type : HRESULT

Code de résultat de cette opération d'API.

## Notes

Cette API est disponible sur Windows, Linux et macOS. Voir aussi StatisticDeleteStatisticDefinitionAsync. Appelez XAsyncGetStatus pour obtenir l'état de l'opération. Si l'appel au service échoue, le résultat asynchrone sera E\_PF\_AGGREGATION\_TYPE\_NOT\_ALLOWED\_FOR\_LINKED\_STAT, E\_PF\_AGGREGATION\_TYPE\_NOT\_ALLOWED\_FOR\_MULTI\_COLUMN\_STATISTIC, E\_PF\_API\_NOT\_ENABLED\_FOR\_TITLE, E\_PF\_DUPLICATE\_COLUMN\_NAME\_FOUND, E\_PF\_DUPLICATE\_STATISTIC\_NAME, E\_PF\_ENTITY\_TYPE\_SPECIFIED\_REQUIRES\_AGGREGATION\_SOURCE, E\_PF\_EXTERNAL\_ENTITY\_NOT\_ALLOWED\_FOR\_TIER, E\_PF\_INVALID\_BASE\_TIME\_FOR\_INTERVAL, E\_PF\_INVALID\_ENTITY\_TYPE\_FOR\_AGGREGATION, E\_PF\_MAX\_QUERYABLE\_VERSIONS\_EXCEEDED, E\_PF\_MAX\_QUERYABLE\_VERSIONS\_VALUE\_NOT\_ALLOWED\_FOR\_TIER, E\_PF\_MULTI\_LEVEL\_AGGREGATION\_NOT\_ALLOWED, E\_PF\_PLAY\_FAB\_ERROR\_EVENT\_NOT\_SUPPORTED\_FOR\_ENTITY\_TYPE, E\_PF\_STATISTIC\_COLUMN\_AGGREGATION\_MISMATCH, E\_PF\_STATISTIC\_COLUMN\_LENGTH\_MISMATCH, E\_PF\_STATISTIC\_COUNT\_LIMIT\_EXCEEDED, E\_PF\_STATISTIC\_DEFINITION\_HAS\_NULL\_OR\_EMPTY\_VERSION\_CONFIGURATION, E\_PF\_STATISTIC\_NAME\_CONFLICT, E\_PF\_STATISTIC\_NOT\_FOUND, E\_PF\_VERSION\_CONFIGURATION\_CANNOT\_BE\_SPECIFIED\_FOR\_LINKED\_STAT, E\_PF\_VERSION\_CONFIGURATION\_IS\_REQUIRED ou l'une des erreurs globales du service PlayFab. Consultez la page de documentation "Handling PlayFab Errors" pour plus de détails sur la gestion des erreurs.

## Configuration requise

**En-tête :** PFStatistics.h

## Voir aussi

[Membres de PFStatistics](/services/playfab/api-references/c/pfstatistics/pfstatistics_members)


## Related topics

- [Vue d'ensemble de l'API C Services - PFStatistics.h](/fr/services/playfab/api-references/c/pfstatistics/pfstatistics_members.md)
- [PFStatisticsGetStatisticDefinitionAsync](/fr/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsgetstatisticdefinitionasync.md)
- [PFStatisticsListStatisticDefinitionsAsync](/fr/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsliststatisticdefinitionsasync.md)
- [PFStatisticsDeleteStatisticDefinitionAsync](/fr/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsdeletestatisticdefinitionasync.md)
- [PFStatisticsUpdateStatisticDefinitionAsync](/fr/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsupdatestatisticdefinitionasync.md)
