Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

I would like to select two record from n number of record in Automated Test case

Posted on by 186
I have one action called 'Reject', when I click on it , the status will go to Reject , When I do the multi selection and Click on Reject It will rejects the all the selected Lines.
In page we used setselectionfilter to work.
 
But, When its comes to automated test case , how can I select the records, even If I do filter the first record is taking place, not the remaining records
 
On the Date filter there are two records, I would like to reject those two.
 
How can I do that. Please suggest your answers.
 
Thank you.
 
Categories:
  • HeinKruger Profile Picture
    HeinKruger 40 on at
    I would like to select two record from n number of record in Automated Test case
    If its more than one record the standard is to use FindSet.
    You add your SetRange and SetFilters and then you use Findset,.
    Inside the FindSet you will Reject them one by one.

    Something like this:
     SalesLine.SetRange("Document Type", SalesLine."Document Type"::Order);
            SalesLine.SetRange("Document No.", SalesHeader."No.");
            SalesLine.SetRange(Type, SalesLine.Type::Item);
            SalesLine.SetFilter("Location Code", '<>%1', '');
            SalesLine.SetLoadFields("Document No.", "Line No.");
            if SalesLine.FindSet() then
                repeat
    SalesLine.Reject.Invoke();
                until SalesLine.Next() = 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans