Skip/Bypass validation in Data Entity Import – D365FO
I had a scenario where I need to create the Tax Exempt Number dynamically when importing Vendors' data.
For instance, if the given VatNum does not exist in the input data, the system should bypass the validation and create the vendor without any error.
So, how do we incorporate this validation? Using the COC method of persistEntity.
public void persistEntity(DataEntityRuntimeContext _entityCtx)
{
next persistEntity(_entityCtx);
this.skipDataSourceValidateField(fieldNum(VendVendorsV2,
VatNum),true);
}