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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to integrate queries by using view?

(0) ShareShare
ReportReport
Posted on by 20
Hi, experts.
I want to integrate these three queries into one. I attempted to create a view for the second query, selecting values from table B without going through table A, and tried to integrate the values from the view along with the data from table C into a string variable for the parent query, but it didn't work well. I want to filter the data based on the condition /tableB.FieldY == tableA.Field1/ only for Field X. I want to get other data without any conditions. How can I integrate them into one query?


while select
        Field1,            
        Field2,            
        Field3,                      
    from
        transactionTemp
{
    TableB transactionLine;
    select minOf(FieldX)  
    from transactionLine
    where transactionLine.FieldY == transactionTemp.Field1;
    
    TableC tempSplit;
    tempS.Field1 = transactionTemp.Field1;
    tempS.Field2 = transactionTemp.Field2;
    tempS.Field3 = transactionLine.FieldX;  
    tempS.insert();
}
while select
        Field1,            
        Field2,            
        Field3,                      
    from
        tempS
    order by
        tempS.Field1,  
        tempS.Field2,  
        tempS.Field3   
{
    str field1 = tempS.Field1;  
    str field2 = tempS.Field2;  
    str field3 = tempS.Field3;  
}
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at
    Wouldn't something like this do the job?
    select Field1, Field2 from transactionTemp
        group by Field1, Field2
        join minOf(FieldX) from transactionLine
            where transactionLine.FieldY == transactionTemp.Field1

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans