web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • MathewR Profile Picture
    10 on at
    RE: Data management package REST API: How to auto-generate PersonnelNumber?

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

             <IsAutoGenerated>true</IsAutoGenerated>

    For PERSONNELNUMBER. Is that not enough?

  • AnithaEswaran Profile Picture
    2,032 on at
    RE: Data management package REST API: How to auto-generate PersonnelNumber?

    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 .

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,351

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 874 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 638 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans