Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How to use mapEntityToDataSource method

(0) ShareShare
ReportReport
Posted on by 171
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.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 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
    André Arnaud de Cal... 292,187 Super User 2025 Season 1 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans