web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Throw error for a line and continue the next line in D365FO while importing in D365FO

(1) ShareShare
ReportReport
Posted on by 29
Im trying  to validate the ASN lines before inserting If Im findinga ny duplicate record then I wanted throw error for that line and continue. I was trying with database operation to skip. but it is throwing me the error Results. Error(s) occurred while writing entity record. When I debugged the issue was with highlighted line. Can anyone help me on this
 
[ExtensionOf(tableStr(WMSItemArrivalJournalLineV2Entity))]
final public class WMSItemArrivalJournalLineV2Entity_Extension
{
//public void initializeEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
    //{   
    //    WMSJournalTrans wmsJournlTrans;
    //    PurchLine purchline;
    //    PurchId purchId;
    //    switch (_dataSourceCtx.name())
    //    {
    //        case dataEntityDataSourceStr(WMSItemArrivalJournalLineV2Entity, WMSJournalTrans):
    //            purchId = WMSJournalTable::find(this.JournalNumber).inventTransRefId;
    //            select firstonly RecId from wmsJournlTrans
    //                exists join purchline
    //                    where purchline.ItemId == wmsJournlTrans.itemId
    //                       && purchline.QtyOrdered == wmsJournlTrans.qty
    //                       && purchline.purchId == purchId
    //                       && wmsJournlTrans.itemId == this.ItemNumber
    //                       && wmsJournlTrans.qty == this.ItemQuantity
    //                       && wmsJournlTrans.inventTransRefId == purchId;
    //            if (wmsJournlTrans.RecId)
    //            {
    //                _dataSourceCtx.setDatabaseOperation(DataEntityDatabaseOperation::None);
    //            }
    //            break;
    //    }
    //    next initializeEntityDataSource(_entityCtx, _dataSourceCtx);
    //}
}
I have the same question (0)

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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 385 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 270

#3
Martin Dráb Profile Picture

Martin Dráb 243 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans