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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

How to fetch data in dynamics 365 bc ?

(0) ShareShare
ReportReport
Posted on by 339

Dear experts in dynamics 365 bc 

How to fetch the data could you please share me syntax of fetch data from one table to another table 

I have the same question (0)
  • SABIH Profile Picture
    339 on at

     Dear Stefano ,

    Finally it is read data from cutbackBatch table to cutaback process table but it is coming as twice time please find below code and screenshot i want to avoid twice time 

    trigger OnAction()
    var
    cutbackbatch: Record "CutBackBatchTable";
    cutbackprocess: Record "CutBackProcessTable";
    begin
    cutbackbatch.Reset();
    cutbackbatch.SETRANGE("Name", "Batch Name");
    cutbackbatch.SetFilter("Bill Code", "Bill Code");
    cutbackbatch.FindFirst();
    if cutbackbatch.FindSet then

    repeat
    cutbackprocess.INIT;

    "Bill Code" := cutbackbatch."Bill Code";
    License := cutbackbatch."License";

    cutbackprocess.Validate("Bill Code", "Bill Code");
    cutbackprocess.Validate("License", "License");
    cutbackprocess.Insert;

    until cutbackprocess.NEXT = 0;


    end;

    }
    prod.PNG
    prod.PNG
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    We answered to this question many times (please don't repeat posts): you need to filter the second table baed on values from the first table, then use REPEAT UNTIL to loop through each records in the returned recordset.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans