• Uday Menkurkar
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Hello Salesforce Community,
I need some help.  I notice the following problem in Lightening ONLY.  No problem in Classic.  Similar to parent-child relationship between Account and Contact objects, I've similar relationship between two custom objects "PP_Deal" (parent) and "Tranche" (child).  In Salesforce Classic, when I create a new Tranche record for an existing PP_Deal record, I see that the associated parent record information (i.e. PP_Deal number) is pre-populated.  Works fine, no problem.  In Lightening, however, the parent record information is not pre-populated.  When clicked on the field, I see a list parent IDs to choose from.  I was hoping, it would similar to Classic.  What am I missing?
For some reason I remember being successfully able to test the following at one point, but it is not working now.  Any help would appreciated.  We have various companies setup with subsidiary account connected to parent using "Parent Account" relationship.  For example, "TeamCo" has two subsidiaries "TeamCo-A" and "TeamCo-B".  We want to be able to see/rolled up any Contacts and Notes/Attachments added for "TeamCo-A" and "TeamCo-B" to be viewable when "TeamCo" is loaded.  And, I swear I've seen it working without any need for code (i.e. native support).  For some reason it is not working.  Can anyone confirm is there is native support which rolls up contacts and notes to the parent?  If not, I must be hallucinating, in which case, any recommendation on how we can see subsidiary contacts/notes at the parent level?  Thanks
How do I use "IF/ELSE" logic (or something better) to avoid displaying a pageblock completely if the related list is empty.  In the code below, a pageblock gets displayed that shows a certain list that is related list.  It is possible that the related list is empty.  The problem is that even if the relatedList has no data, an empty block "Higher Probability" gets displayed.  How do I avoid displaying the pageBlock completely if the relatedList is empty?

Thanks
<apex:pageBlock title="Higher Probability">
        <apex:pageBlockTable value="{! highLikelihoodDeals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">            
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                    </apex:pageBlockTable>
            </apex:column>
            <apex:column headerValue="Comments" value="{! ds.Deal_Description__c }"/>
        </apex:pageBlockTable>
    </apex:pageBlock>

 
Is it possible to have multiple instantiations of a StandardController?  For example, in a VF page below I would like to display two types of lists.  Deals which with "High Likelihood" and deals with "Low Likelihood".  And for each Deal I'm also displaying associated child records.  Currently I've only one query in the extension controller "extCon".  What I would like to do is split the query into two queries so I can add a WHERE clause to both and show two separate page blocks in the same page.  Is it possible to have two separate controller instantiations?  Or, is there better way to accomlish the same task??

<!-- Visualforce code -->
<apex:page standardController="PP_Deals__c" recordSetVar="deals" extensions="extCon">

    <font size="5" color="blue"> <b> Private Placement - Active Deal Log1 </b> </font>
   
    <apex:pageBlock title="Higher Chance">
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">           
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                  </apex:pageBlockTable>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
   
    <apex:pageBlock title="Lower Chance">
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">           
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                  </apex:pageBlockTable>
            </apex:column>
 
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

And, here is the extension controller code.  Here I'm wondering if it is possible to have two separate initiations so I can add a WHERE clause??  And, if yes, how to call two separate initiations in VF above??

public class extCon {
    private final PP_Deals__c deal;
  
    public extCon(ApexPages.StandardSetController controller) { 
               controller = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id, Name FROM PP_Deals__c]));
    }
}

Thanks
Question for VF/Apex experts.

I'm unable to load child records from a master-detail relationship using Apex and Visualforce.  Here is my setup.  I've Master-Detail relationship between PP_Deals__c (Master object) and Tranche__c (Child object).  My goal is to display parent-child records meeting certain criteria using VF page and a custom list controller.  My sample VF page and Apex extension controller is below.  The problem is that I can see the parent records but no child records.  If I remove the WHERE clause in the query, I can see all the records.  Also, if I put a specific parent id in the parent clause I can see records, but in its current form it I don't see child records when in principal the WHERE clause should have the correct id.  What am I missing?

Thanks in advance for help.

<!-- Visualforce code -->
<apex:page standardController="PP_Deals__c" recordSetVar="deals" extensions="extCon">
    <apex:pageBlock >
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Name }"/>
            <apex:column value="{! ds.id }"/>

            <apex:column >            
                <apex:pageBlock >
                    <apex:pageBlockTable value="{! relatedTranches}" var="val">
                        <apex:column value="{! val.name}"/>
                        <apex:column value="{! val.Id}"/>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:column>
            
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

//  Associated Apex Code -- Controller List extension
public class extCon {   
    private final PP_Deals__c deal;
    
    public extCon(ApexPages.StandardSetController controller) {
        deal = (PP_Deals__c) controller.getRecord();
    }
    
    public List<Tranche__c> getrelatedTranches()
    {
        List <Tranche__c> conList = New List<Tranche__c>();
        
        for(PP_Deals__c acc:[ SELECT id,name, (SELECT id, name FROM Tranches__r) FROM PP_Deals__c WHERE id = :deal.id ])
        {
           for(Tranche__c con:acc.Tranches__r)
               conList.add(con);
        }

        return conList;
    }
}
Hello Salesforce Community,
I need some help.  I notice the following problem in Lightening ONLY.  No problem in Classic.  Similar to parent-child relationship between Account and Contact objects, I've similar relationship between two custom objects "PP_Deal" (parent) and "Tranche" (child).  In Salesforce Classic, when I create a new Tranche record for an existing PP_Deal record, I see that the associated parent record information (i.e. PP_Deal number) is pre-populated.  Works fine, no problem.  In Lightening, however, the parent record information is not pre-populated.  When clicked on the field, I see a list parent IDs to choose from.  I was hoping, it would similar to Classic.  What am I missing?
How do I use "IF/ELSE" logic (or something better) to avoid displaying a pageblock completely if the related list is empty.  In the code below, a pageblock gets displayed that shows a certain list that is related list.  It is possible that the related list is empty.  The problem is that even if the relatedList has no data, an empty block "Higher Probability" gets displayed.  How do I avoid displaying the pageBlock completely if the relatedList is empty?

Thanks
<apex:pageBlock title="Higher Probability">
        <apex:pageBlockTable value="{! highLikelihoodDeals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">            
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                    </apex:pageBlockTable>
            </apex:column>
            <apex:column headerValue="Comments" value="{! ds.Deal_Description__c }"/>
        </apex:pageBlockTable>
    </apex:pageBlock>

 
Is it possible to have multiple instantiations of a StandardController?  For example, in a VF page below I would like to display two types of lists.  Deals which with "High Likelihood" and deals with "Low Likelihood".  And for each Deal I'm also displaying associated child records.  Currently I've only one query in the extension controller "extCon".  What I would like to do is split the query into two queries so I can add a WHERE clause to both and show two separate page blocks in the same page.  Is it possible to have two separate controller instantiations?  Or, is there better way to accomlish the same task??

<!-- Visualforce code -->
<apex:page standardController="PP_Deals__c" recordSetVar="deals" extensions="extCon">

    <font size="5" color="blue"> <b> Private Placement - Active Deal Log1 </b> </font>
   
    <apex:pageBlock title="Higher Chance">
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">           
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                  </apex:pageBlockTable>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
   
    <apex:pageBlock title="Lower Chance">
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Issuer__c }"/>
            <apex:column headerValue="Bids Due" value="{! ds.Circle_Due_Date__c }"/>
            <apex:column headerValue="Maturities">           
                    <apex:pageBlockTable value="{!ds.Tranches__r}" var="val">
                        <apex:column headerValue="Tenor" value="{! val.name }"/>
                  </apex:pageBlockTable>
            </apex:column>
 
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

And, here is the extension controller code.  Here I'm wondering if it is possible to have two separate initiations so I can add a WHERE clause??  And, if yes, how to call two separate initiations in VF above??

public class extCon {
    private final PP_Deals__c deal;
  
    public extCon(ApexPages.StandardSetController controller) { 
               controller = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id, Name FROM PP_Deals__c]));
    }
}

Thanks
Question for VF/Apex experts.

I'm unable to load child records from a master-detail relationship using Apex and Visualforce.  Here is my setup.  I've Master-Detail relationship between PP_Deals__c (Master object) and Tranche__c (Child object).  My goal is to display parent-child records meeting certain criteria using VF page and a custom list controller.  My sample VF page and Apex extension controller is below.  The problem is that I can see the parent records but no child records.  If I remove the WHERE clause in the query, I can see all the records.  Also, if I put a specific parent id in the parent clause I can see records, but in its current form it I don't see child records when in principal the WHERE clause should have the correct id.  What am I missing?

Thanks in advance for help.

<!-- Visualforce code -->
<apex:page standardController="PP_Deals__c" recordSetVar="deals" extensions="extCon">
    <apex:pageBlock >
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Name }"/>
            <apex:column value="{! ds.id }"/>

            <apex:column >            
                <apex:pageBlock >
                    <apex:pageBlockTable value="{! relatedTranches}" var="val">
                        <apex:column value="{! val.name}"/>
                        <apex:column value="{! val.Id}"/>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:column>
            
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

//  Associated Apex Code -- Controller List extension
public class extCon {   
    private final PP_Deals__c deal;
    
    public extCon(ApexPages.StandardSetController controller) {
        deal = (PP_Deals__c) controller.getRecord();
    }
    
    public List<Tranche__c> getrelatedTranches()
    {
        List <Tranche__c> conList = New List<Tranche__c>();
        
        for(PP_Deals__c acc:[ SELECT id,name, (SELECT id, name FROM Tranches__r) FROM PP_Deals__c WHERE id = :deal.id ])
        {
           for(Tranche__c con:acc.Tranches__r)
               conList.add(con);
        }

        return conList;
    }
}