• Allen Moy
  • NEWBIE
  • 9 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I have two custom objects in a Master-Detail relationship: "Reservation" is a child of "Day". I have created a custom lightning component to lookup Reservations based upon the Day and other criteria saved into the SOQL query in the Apex controller. I want my component to appear on the Day record page. When I go to "Edit Page" for the Day record the custom component does not appear. However, when I go to "Edit Page" for the Reservation record, the component does appear and can be placed on the page. How do I get this component - essentially a customized Related List - to become available for the parent page?
I used the example on this site as a model to build my custom controller and page but my resulting page has no data. What am I missing?

Here is my custom controller:
public with sharing class MarketReservationDetails {
 
    public List <Farmers_Market_Reservation__c> Records {get; set;}
    public MarketReservationDetails() {
        Records = 
            [SELECT id, Farmers_Market_Day__c, Producer_Type__c, Producer_Name__c, 
               Producer_Stall_Space__c FROM Farmers_Market_Reservation__c
               WHERE RecordTypeID='01216000001IiQx'
               AND Farmers_Market_Day__c=:ApexPages.currentPage().getParameters().get('id')];
    }
}

And here is my page:

<apex:page controller="MarketReservationDetails" sidebar="false" showHeader="false">
    <apex:form >
    <apex:pageBlock >
    <apex:pageMessages />
    <apex:pageBlock >
        Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
    </apex:pageBlock>
    <apex:pageBlockTable value="{!Records}" var="R">
        <apex:outputField value="{!R.Producer_Type__c}"/>
            <apex:outputField value="{!R.Producer_Name__c}"/>
            <apex:outputField value="{!R.Producer_Stall_Space__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>    
</apex:page>    
I have two custom tables Produce_Order__c is a parent to Produce_Order_Item__c.

If I put in the <apex:detail /> component. I see the related list for the child records. If I put in <apex:relatedList > I get a Visualforce Error that it is not a valid child relationship name for entity Produce Order. I have tried a dozen different options for <apex:relatedList list="Child LIst" > with always the same error. 

Here is a snippet of my code.

<apex:page standardController="Produce_Order__c" sidebar="false" >
    <apex:sectionHeader title="{!Produce_Order__c.Name} - {!Produce_Order__c.Pickup_Date__c}" subtitle="{!Produce_Order__c.Pickup_Site__r.Name}" />
    <apex:pageBlock title="{!Produce_Order__c.Farmers_Market_Producer__r.Name}" >
        <apex:pageblockSection columns="1">
            <apex:relatedList list="Produce Order Items"/ >
        </apex:pageblockSection>
    </apex:pageBlock>
</apex:page>

Thanks!
Hello
I am working on a flow and one of the things it needs to do is query PriceBookEntry. For some reason the fast lookup is not finding any records, but when I test the same query with soql executed on workbench the record is found. I'm a bit stumped on what to do next. So hopfully someone out there has some ideas. 

Here is excerpt from the debug email that shows what the fast lookup is doing:
FAST LOOKUP: Get_Standard_PBE_PP
Find all PricebookEntry records where:
Platform__c Equals {!Pureprofile} (Pureprofile)
Pricebook2Id Equals {!varQuote.Pricebook2Id} (01s90000004YFPxAAO)
CurrencyIsoCode Equals {!varQuote.CurrencyIsoCode} (AUD)
Incidence_Rate__c Equals {!formulaIncidenceRate} (10.00)
Length_of_Interview__c Equals {!Length_of_Interview2} (20)
Assign those records to {!sovPBEM}.
Save these field values in the variable: Id
Result
Failed to find records.

And here is the soql that actually finds the record
SELECT 
    Id, 
    name, 
    currencyisocode 
FROM PricebookEntry 
where 
    Length_of_Interview__c = 20 and 
    Incidence_Rate__c = 10.00 and 
    Platform__c = 'Pureprofile' and 
    Pricebook2id = '01s90000004YFPxAAO' and 
    CurrencyIsoCode = 'AUD'

 
I used the example on this site as a model to build my custom controller and page but my resulting page has no data. What am I missing?

Here is my custom controller:
public with sharing class MarketReservationDetails {
 
    public List <Farmers_Market_Reservation__c> Records {get; set;}
    public MarketReservationDetails() {
        Records = 
            [SELECT id, Farmers_Market_Day__c, Producer_Type__c, Producer_Name__c, 
               Producer_Stall_Space__c FROM Farmers_Market_Reservation__c
               WHERE RecordTypeID='01216000001IiQx'
               AND Farmers_Market_Day__c=:ApexPages.currentPage().getParameters().get('id')];
    }
}

And here is my page:

<apex:page controller="MarketReservationDetails" sidebar="false" showHeader="false">
    <apex:form >
    <apex:pageBlock >
    <apex:pageMessages />
    <apex:pageBlock >
        Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
    </apex:pageBlock>
    <apex:pageBlockTable value="{!Records}" var="R">
        <apex:outputField value="{!R.Producer_Type__c}"/>
            <apex:outputField value="{!R.Producer_Name__c}"/>
            <apex:outputField value="{!R.Producer_Stall_Space__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>    
</apex:page>