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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Expected return quantity must not be zero in return order form?

(0) ShareShare
ReportReport
Posted on by 290

There is a warning in the return order which says "Expected return quantity must not be zero". However, this warning sometimes is shown when the user creates a new return order and wants to add lines using 'find sales order' button or manually by choosing item ID. The warning is shown repeatedly and the user cannot proceed until removing the empty line (sometimes they even can't remove the empty line unless they fill the mandatory fields such as item id and invent site id ). I cannot tell in which situation the user faces this warning because not all users have this problem and not all the time the warning is shown.
It seems sometimes Salesline data source validateWrite in ReturnTable form is called without any reason. I am investigating to check if it is related to any customization but as this is the old issue there is a low probability that customization leads to this problem. Also I checked call stack validationWrite is called from salesTable leaveRecord method but the caller of the leave record method is not indicated
I want to know that if anyone has reported this problem?

4606.Capture.PNG

I have the same question (0)
  • Anders Even Girke Profile Picture
    on at

    Hi Nastaran

    This validation should/is triggered when the line is saved or attempted save. If your issue continue please log an offcial bug with a clear repro

  • Nastaran Profile Picture
    290 on at

    I should inform that by setting insertIfEmpty property of salesLine datasource to false value, I remove the empty line  and because there is no empty line the issue will not raised.

     [FormDataSourceEventHandler(formDataSourceStr(ReturnTable, SalesLine), FormDataSourceEventType::Initialized)]
        public static void SalesLine_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
        {
            sender.insertIfEmpty(false);
        }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 122 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans