Skip to main content

Notifications

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;  
}
  • Suggested answer
    Martin Dráb Profile Picture
    233,704 Most Valuable Professional on at
    How to integrate queries by using view?
    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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 481 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 310

#3
Saalim Ansari Profile Picture

Saalim Ansari 276

Overall leaderboard

Product updates

Dynamics 365 release plans