web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Data management package REST API: How to auto-generate PersonnelNumber?

(0) ShareShare
ReportReport
Posted on by 10

I have been trying to import an employee data package via the Data management API, with the following content:

Manifest.xml

<DataManagementPackageManifest xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../DataManagement">
  <DefinitionGroupName>Descriptionc</DefinitionGroupName>
  <Description></Description>
  <PackageEntityList>
    <DataManagementPackageEntityData>
      <DefaultRefreshType>FullPush</DefaultRefreshType>
      <Disable>false</Disable>
      <EntityMapList>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>PERSONNELNUMBER</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull>
          <IsAutoGenerated>true</IsAutoGenerated>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>PERSONNELNUMBER</XMLField>
        </EntityMap>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>EMPLOYMENTLEGALENTITYID</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsAutoGenerated>false</IsAutoGenerated>
          <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>EMPLOYMENTLEGALENTITYID</XMLField>
        </EntityMap>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>FIRSTNAME</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsAutoGenerated>false</IsAutoGenerated>
          <IsDefaultValueEqualNull>true</IsDefaultValueEqualNull>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>FIRSTNAME</XMLField>
        </EntityMap>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>NAMEALIAS</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsAutoGenerated>false</IsAutoGenerated>
          <IsDefaultValueEqualNull>true</IsDefaultValueEqualNull>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>NAMEALIAS</XMLField>
        </EntityMap>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>EMPLOYMENTSTARTDATE</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsAutoGenerated>false</IsAutoGenerated>
          <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>EMPLOYMENTSTARTDATE</XMLField>
        </EntityMap>
        <EntityMap>
          <ArrayIndex>0</ArrayIndex>
          <EntityField>EMPLOYMENTENDDATE</EntityField>
          <EntityFieldConversionList i:nil="true"></EntityFieldConversionList>
          <IsAutoDefault>false</IsAutoDefault>
          <IsAutoGenerated>false</IsAutoGenerated>
          <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull>
          <UseTextQualifier>false</UseTextQualifier>
          <XMLField>EMPLOYMENTENDDATE</XMLField>
        </EntityMap>
      </EntityMapList>
      <EntityName>Employee</EntityName>
      <EntityTransformList i:nil="true"></EntityTransformList>
      <ExcelSheetName></ExcelSheetName>
      <ExecutionUnit>1</ExecutionUnit>
      <FailExecutionUnitOnError>true</FailExecutionUnitOnError>
      <FailLevelOnError>true</FailLevelOnError>
      <InputFilePath>Data.csv</InputFilePath>
      <LevelInExecutionUnit>1</LevelInExecutionUnit>
      <RunBusinessLogic>true</RunBusinessLogic>
      <RunBusinessValidation>true</RunBusinessValidation>
      <SampleFilePath></SampleFilePath>
      <SequenceInLevel>1</SequenceInLevel>
      <SourceFormat>CSV-Unicode</SourceFormat>
      <TargetEntity>HcmEmployeeEntity</TargetEntity>
      <ValidationStatus>Yes</ValidationStatus>
    </DataManagementPackageEntityData>
  </PackageEntityList>
  <ProjectCategory>0</ProjectCategory>
  <RulesData i:nil="true"></RulesData>
</DataManagementPackageManifest>


Data.csv

EMPLOYMENTLEGALENTITYID,FIRSTNAME,NAMEALIAS,EMPLOYMENTSTARTDATE,EMPLOYMENTENDDATE
dat,Test987650,Test987654,2020-02-02,2024-02-02
dat,Test987651,Test987653,2020-02-02,2024-02-02

It always fails I believe because PersonnelNumber is not specified (if I specify PersonnelNumber, it imports succesfully), but this does not make sense to me.
Are clients supposed to generate PersonnelNumber manually? How do we guarentee that the PersonnelNumber we generate is unique?
Does anyone have a working data package for importing employees?
Lastly, I noticed that there is a AutoGenerate field in the field maps (it has no effect as far as I have tested), but is there any API to check if a field is auto-generated or not?

I have the same question (0)
  • AnithaEswaran Profile Picture
    2,032 on at

    Hi,

    It depends on the set up in F&O.

    If the personnel number is set as manual, it will accept the values passed. If it is as AutoGenerated in the number sequence , then empty values will throw error.

    I suggest you to enable 'Auto Generated' in Entity mapping .

  • MathewR Profile Picture
    10 on at

    In the Manifest.xml file above, I have set:

             <IsAutoGenerated>true</IsAutoGenerated>

    For PERSONNELNUMBER. Is that not enough?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 545 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans