
Hi,
I am trying to import some csv data in d365 through a DMF project and have created my custom entity for this purpose . My target table contains a unique index which is a combination of (CustAccount and VendAccount columns) but in the source file I am not getting the VendAccount column. So , I have created a virtual column in my data entity and staging table named as vendAccount and trying to populate this column in the postload() method of the data entity .
/// <summary>
///
/// </summary>
public void postLoad()
{
super();
this.VendAccount = AVAJurisdictionTable::getVendAccountFromJuristicion(this.Jurisdiction);
}
Now, for some reason I am not getting the values in the source buffer (this) as a result of which VendAccount never gets populated and the DMF execution fails on copying data from staging to target . Any ideas on how to bypass this issue ?
postLoad() is used when loading entity data from database, i.e. on export.
Use mapEntityToDataSource() for import. You can find an example in F&O documentation: Computed columns and virtual fields in data entities > Example: Use a virtual field to receive and parse an inbound field.
By the way, please use Insert > Code (in the rich formatting view) to paste source code.