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, ...
Suggested answer

How to use mapEntityToDataSource method

(0) ShareShare
ReportReport
Posted on by 230
Hi Team,
 
Using PurchPurchaseOrderHeaderV2Entity i am importing the data.
 
PurchPurchaseOrderHeaderV2Entity.OrderVendorAccountNumber field data i am getting from custom parameter table instead of import file. So that i am writing the logic in entity postGetStagingData method and in mapping details i have set Auto default Yes of OrderVendorAccountNumber field.
 
Using above approach i am able to import the data.
 
But my client don't want to set Auto default Yes, is should handle through code.
 
For that i writing the my logic in mapEntityToDataSource method.
 
But i am getting below error.
Field 'Vendor account' must be filled in.
I have the same question (0)
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    How to use mapEntityToDataSource method
    As Andre suggested, this field is mandatory in staging. As making mandatory to no is not possible as it is standard. I think custom entity should be created in this scenario.
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    298,642 Super User 2025 Season 2 on at
    How to use mapEntityToDataSource method
    Hi,
     
    You might currently get the error due to the fact that the field for the vendor account is mandatory on the data entity an/or staging table. Using the method mapEntityToDataSource filling of the vendor account is done after inserting details in the staging table. So, ensure the data entity and staging table does not have this field set as mandatory. The auto default is then not required to set. 

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,340

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 640 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans