Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Guides forum / How to integrate queri...
Guides forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

How to integrate queries by using view?

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

Helpful resources

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans