function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deanna Aaron 4Deanna Aaron 4 

Perform a union on a SOQL query

I'm looking to perform a union non a SOQL query. How would I do this?
I'm basically trying to join/combine two queries.

For example:
Contract line item with no shipping address
Payment with an error message in the description field

In this example, there is a relationship between the Contract Line Item and Payment (Not Parent-Child)

The path would be:
Payment > Billing Document > Contract > Contract Line Item
asp04__Payment__c > ffasp__BillingDocument__c > ffbc__Contract__c > ffbc__ContractLineItem__c
How would I create a join the queueries?

SELECT Name, fferpcore__BillingDocument__c, fferpcore__ProductService__c, ffbc__ContractLineItem__c, Id
FROM asp04__Payment__c
WHERE Include_in_Rev_Rec__c =FALSE
---Next---
SELECT fferpcore__Account__c, fferpcore__CustomerReference__c, fferpcore__DocumentDate__c
FROM ffbc__ContractLineItem__c 
WHERE fferpcore__DocumentStatus__c = 'Complete' AND TPx_Special_Invoice__c=FALSE AND fferpcore__DocumentType__c ='Invoice'

Thank you for your help!

MagulanDuraipandianMagulanDuraipandian
Deanna,
Union is not supported in SOQL. You can try this in report.

--
Magulan Duraipandian
https://infallibletechie.medium.com/