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, ...
Answered

Data entity update not working

(1) ShareShare
ReportReport
Posted on by 536
Hi,

I created a new entity for AXTip_PurchInvoice (table AXTip_PurchInvoice comes from a third party module which is Axtension)
 
I made the entity key as: Invoice, voucher, TransDate, vendAccount, DocumentDate
 
I'm interested in updating a field called ReferencePersonnelNumber
 
So i outer joined the dataSource of the entity (AXTip_PurchInvoice) with HcmWorker, and joined HcmWorker with DirPerson, in order to add the /name/ field to the entity for the ReferencePersonnelNumber

When i import an excel file to update this ReferencePersonnelNumber for a certain invoice -- import is successful and i get that 1 record got updated in DMF. However, I noticed that the field /ReferencePersonnelNumber/ gets updated for all invoices with the same vendAccount and not just one. And the AP responsible filed on the vendor itself gets also updated.

This is the field I'm interested in updating  (Accounts payable - invoices - Invoice processing shared service center - all invoices)



And this is the field for the vendor



I tried to update another field and it was working fine.. not sure how can i update this ReferencePersonnelNumber field without affecting other invoices with the same vendor and without affecting the AP responsible field on the vendor itself. Any idea?
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,763 Most Valuable Professional on at
    If you change setup of the vendor itself, as the screenshot suggests, that's not anything specific to an individual invoice. If you want to change a value on a single invoice, you will need to add a field to the invoice table.
  • André Arnaud de Calavon Profile Picture
    303,349 Super User 2026 Season 1 on at
    Hi Deldyn,
     
    It is hard to know what you have done exactly and I don't know the data model of this ISV solution. I can't check if your entity key is correct or not. In case it is updating a value at the vendor details, can you tell us if you also included the VendTable table as data source in your data entity?
  • DELDYN Profile Picture
    536 on at
    Hi Andre,

    No vendTable is not in the entity. My issue is that it updates vendTable in addition to updating all invoices related to the vendor. And I don't think the issue is with the entity key, because as I said if i update a different field, the update works as expected.

    ​​​​​​​Hi Martin,

    I'm not changing the field on the vendor itself.

    So the "AP responsible" field value on the vendor, is normally what gets filled in "ReferencePersonnelNumber" in "AXTip_PurchInvoice" Table.
    However, we can edit this ReferencePersonnelNumber field on the invoice manually to sth else without affecting the vendor field (this is done for invoices with invoice status: registered and process step: Post)
    Now what i wanted to do is update this "ReferencePersonnelNumber" via data entity for a specific invoice (as i described in the question). However, when i update this field via the entity, it updates the "ReferencePersonnelNumber"  for all invoices related to the same vendor in addition to updating the vendor "APResponsible" field and no just the invoice that i chose.
    However, if i update a different field alone like payMode, it works correctly and only updates the invoice chosen.

    So here  you can see the reference employee became the same for all invoices related to the vendor even though i updated only one invoice






    here's the file i imported


    referencedEmployeeName is taken from DirPeson data source of the entity



  • André Arnaud de Calavon Profile Picture
    303,349 Super User 2026 Season 1 on at
    Hi Deldyn,
     
    Do you have additional coding on the data entity? As mentioned, it will be hard to support you with tables from ISV solutions which I'm not familiar with. You can also consider reaching out to AXtension for some help.
  • DELDYN Profile Picture
    536 on at
    Hi Andre,

    There is no code on the entity, i just created it.

    I think my analysis was wrong, so what currently is happening, is that the personnel number i import via excel is not being updated for the invoice, however, the name of hcmworker is being updated instead, and personnel number is staying the same. I want the reference employee personnel number to change on the invoice based on the name i imported in the excel sheet, so the name i imported via excel, should have a matching worker and the invoice should be updated with this new worker.

    Here's a full example.

    So i want to update the invoice that ends with 573  -- as you can see reference employee ends with 296


    and here's the "AP responsible" field value on the vend account that ends with 529, it's name ends with ng where it's personnel number is the one that ends with 296


    Now i will do the following import via DMF --i chose a new employee name for the invoice that ends with 573



    Now here's what happened, the referenced employee personnel number stayed as is, however it updated the name of the worker instead of looking for the worker that matches the name i imported in excel

    this screenshot is from hcmWorker, as you can see search name stayed as the one that ends with "ng", however name got updated to a new value which is the name i imported (personnel number stayed as 296)


    and here's the result for the invoices, at first when i saw the name changing, i thought it's updating all invoices, but actually it's updating the original hcmworker name and reference employee stayed as is



    How can i make the personnel number to change to an exisiting personnel number for the name that i specified in the excel when i imported??
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,349 Super User 2026 Season 1 on at
    Hi Deldyn,
     
    Can you confirm if you provide an employee name in the source file which should then try to find a matching worker based on that name? In that case, you can better use a virtual field instead of the additional data sources and use some x++ coding to set the referenced employee value.
  • DELDYN Profile Picture
    536 on at
    Hi Andre,

    I didn't understand what do you mean by this:
    "Can you confirm if you provide an employee name in the source file which should then try to find a matching worker based on that name?"

    As I said, if i import a name in the excel file, what it does is that it updates the name of the hcmWorker instead of updating the personnel number of the invoice to a new personnel number based on the name provided.

    Also how virtual fields are going to help? can you explain more what shall i do to fix my issue?

    Another thing to add, i just added "ReferencePersonnelNumber" from AXTip_PurchInvoice to the entity fields, and I tried to import this field directly to update it instead of using hcmWorker and dirperson, but nothing got reflected.
  • Martin Dráb Profile Picture
    238,763 Most Valuable Professional on at
    One obvious bug is that you didn't set DirPerson (and likely HcmWorker too) datasource as read-only. As I understand, you want them just for data references and no data should change there, but you're current implementation doesn't match your intention.
     
    I wouldn't use a virtual field unless absolutely necessary, because it has quite a few drawbacks. If you failed to get it working just through table relations and you'll need to find the personnel number in code, you can do it mapEntityToDatasource().
  • DELDYN Profile Picture
    536 on at
    Hi Martin,

    I already tried yesterday to make both hcmWorker and DirPerson as read only, but when i did that -- no update occurred and the "ReferencePersonnelNumber" stayed as is.
    And i don't think the relations are wrong.
    Here's the entity

    and here's the table relation


    And as I said, I even tried to update ReferencePersonnelNumber via DMF directly, without using Name from DirPerson -- and still no update occurred, ReferencePersonnelNumber stayed as is.

    Can you please explain more what do i need to do with mapEntityToDatasource()? and do i still need DirPerson and HcmWorker in my entity?

  • Martin Dráb Profile Picture
    238,763 Most Valuable Professional on at
    I see you have ReferencePersonnelNumber in the staging table, which is completely new information. Does it mean that you're getting it a file? If so, then there is no problem at all. Import ReferenceEmployeeNumber to AXTip_PurchInvoice and ignore the ReferenceEmployeeName, because you already have the right value in F&O.
     
    If you actually aren't getting ReferencePersonnelNumber, then your attempt to find the worker by ReferencePersonnelNumber obviously can't work, because you don't have the number to find it by.

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... 509 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 375

#3
Adis Profile Picture

Adis 268 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans