Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of App with an inner SOQL query #22

Open
rrobinsoncpa opened this issue Feb 7, 2017 · 0 comments
Open

Use of App with an inner SOQL query #22

rrobinsoncpa opened this issue Feb 7, 2017 · 0 comments

Comments

@rrobinsoncpa
Copy link

I have two Objects (Deal__c and Property__c) with a junction Object (Deal__Properties__c). I am attempting to use the app to pull data from selected Property fields based on the specific Deal Id. I can make the app work if I abandon the junction Object and place a field on the Property Object that looks up the Deal. The app is then as follows:
_<apex:page standardController="Deal__c">
<apex:form >

    <!-- Editable grid with customization turned on -->   
    <c:tableGrid type="Property__c" 
                 fields="Name, Asset_Type__c, Portfolio__c, Campus_Type__c, Market__c"
                 filter="Deal_to_Link__c = '{!Deal__c.Id}'"
                 sortBy="Asset_Type__c"
                 image="/img/icon/hands24.png"
                 sortDescending="true"
                 title="Properties" 
                 gridPageId="editable"
                 customizeFields="true"
                 customizeFilter="true"
                 saveSettings="true"
                 pageSize="25"
                 mode="list"/>                         
</apex:form>

</apex:page>_

This does work, but would either require manual maintenance of the Deal_to_Link field, or writing an Apex Trigger to populate the field. I then went back to using the Deal_Property junction object, and created a SOQL statement that returns the desired records:

SELECT
(SELECT Property__c, Property__r.Name, Property__r.Asset_Type__c, Property__r.Portfolio__c, Property__r.Campus_Type__c, Property__r.Market__r.Name
FROM Deal_Properties__r)
FROM Deal__c
WHERE Id = 'a06o000000EaLsT' I used a specific Deal Id to test.

My questions are: can this app be used with an inner SOQL statement (as shown above) and if so, what would the syntax be? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants