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

Data Entity set the Reference (RecId) on datasource

(2) ShareShare
ReportReport
Posted on by 6,494
Hello,
there is a standard data entity for Planned Orders (ReqPlannedOrderEntity), which is read-only and we wanted to change it.
I have duplicated it and set Read-Only to No.
I have removed some datasources too and currently I keep only ReqPo and InventDim.
The Key on datasource and on table ReqPo is a PlannedOrderID (RefId) and PlanVersion (RefRecId to ReqPlanVersion table).
I have a unmapped str field on data entity which during the export is filled by the PlanVersion Id in the postLoad method.
But I have problem during the Import. Even though I have value in the PlanVersionId field in Excel, when I import it I do not see the value (during debugging) in any of the following methods (mapEntityToDataSource, mapDataSourceToEntity, postLoad). And I'm getting error that the Reference isn't set (because of the PlanVersion field, which is refRecId).
How can I achieve it? Which method can I use?
So, I have a value in excel column and this column/field is mapped to an /UnMapped/ field of Data entity / staging table. And I want to use this value (which is the plan version id) to find a recid of ReqPlanVersion table.
  • Suggested answer
    Anthony Blake Profile Picture
    3,224 Super User 2026 Season 2 on at
    Take a look here:
     
     
    There are a few options:
     
    Handle creation manually from unmapped field using mapEntityToDataSource 
    Create the data entity from scratch using the wizard
    Take a look at how some standard entities handle the same situation, there al lots of RefRecId references in standard code.
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Please send your code which you have written in mapentitytodatasource method. 
  • Johnny Profile Picture
    6,494 on at
    As I see ValidateWrite is executed first and it thrwos error that Reference isn't set, so it does not even go to mapEntityToDataSource where I assign value to "Reference" field.
    So, what would be a place place to place the code?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 366

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 360 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans