Skip to main content

Notifications

Business Central forum
Unanswered

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

Posted on by 151
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 27 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;

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,907 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,189 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans