• James Moore 52
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hello, 

I'm trying to render a visualforce page based on a value passed from another record.  The Custom Button URL i'm using to open the VF page is:
/apex/AvailableInstructors?id={!Lesson__c.Id}&Date_c={!Lesson__c.Lesson_Date__c}


and rendering the records using the following:
 
<apex:pageblocktable value="{!schedules}" var="s" columns="13" rendered="{!Schedule_Availability__c.Date__c== DATEVALUE($CurrentPage.parameters.Date__c)}" >
The VF page is showing all records and not rendering it based on the date value passed.  Any help would be appreciated!

Thanks!
Hello, 

I'm hoping it's possible to pass parameters to a flow using URLFOR and a custom button.  I've created a VF page to list instructors available on a specific lesson day by passing the parameters of the lesson record ID , and the Lesson date within the url of the VF page button.  Then created custom buttons to fire a Flow to "assign" or update the instructor on the lesson record.  My first attempt using <param name= 'name'> to pass the varInstructorId and the varLessonId was not working, so i'm trying to pass the parameters within the URLFOR command.

VF Page:
<apex:page standardcontroller="Schedule_Availability__c" recordSetVar="schedules" showHeader="FALSE" sidebar="False">
<apex:messages />
      <!-- CSS -->
  <style>
    .lead {
      color: green; 
      font-weight: bold;    
    }
    .assist {
      color:red;
      font-weight: bold; 
    }
  </style>
    <apex:form id="theForm">
        <apex:pageblock mode="maindetail"  title="{!$ObjectType.Schedule_Availability__c.label} for {!DATEVALUE($CurrentPage.parameters.Lesson__c.Lesson_Date__c)} "> 
            
            <apex:outputpanel id="Available">
                <apex:pageblocktable value="{!schedules}" var="s" columns="13" rendered="{!Schedule_Availability__c.Date__c= DATEVALUE($CurrentPage.parameters.Lesson__c.Lesson_Date__c)}" >
                    <apex:Column styleClass="header" headervalue="Instructor" value="{!s.Instructor_Volunteer__c}"/>
                     <apex:Column value="{!s.Discipline__c}"/>
                    <apex:Column styleClass="lead" Headervalue="Lead Skills" value="{!s.Lead_Instructor_Skills__c }" style="color:green"/>
                    <apex:Column styleClass="assist" Headervalue="Asst Skills" value="{!s.Assistant_Instructor_Skills__c}" style="color:red"/>
                    <apex:Column value="{!s.Date__c}"/>
                    <apex:Column value="{!s.Job_Roles__c}"/>
                    <apex:Column headervalue="AM" value="{!s.Booked_AM__c}"/>
                    <apex:Column headervalue="PM" value="{!s.Booked_PM__c}"/>                  
                    <apex:column headervalue="Eve" value="{!s.Booked_Evening__c}"/> 
                    <apex:column headervalue="Lead Instr.">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Lead_Instructor,Id,[varInstructorId='s.Instructor_Volunteer__c', varLessonId='$CurrentPage.parameters.id'])}" id="assign" value="Assign Lead"/>           
                    <!--<apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"/>
                    <apex:param name="varLessonId" value="{!Id}"/>-->
                    </apex:column>
                    <apex:column headervalue="Asst 1">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst1" value="Assign Asst 1"/>
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />        
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                    <apex:column headervalue="Asst 2">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst2" value="Assign Asst 2"/>           
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />  
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                    <apex:column headervalue="Asst 3">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst3" value="Assign Asst 3"/>           
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />  
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                </apex:pageblockTable>
        <apex:panelGrid columns="3">
          <apex:commandButton action="{!previous}" value="Previous"/>
          <apex:commandButton action="{!next}" value="Next" />
          <apex:commandButton action="{!cancel}" value="Close Window" />
        </apex:panelGrid>
            </apex:outputpanel>
        </apex:pageblock>
    </apex:form>
      

</apex:page>

Custom Button:
/apex/AvailableInstructors?id={!Lesson__c.Id}&Date_c={!Lesson__c.Lesson_Date__c}

There are a few other issues i'm having with this page, but the most critical is inserting the Instructor__c onto the Lesson Record.  I'm trying  to stay away from apex, since this will need to be maintained by a non-profit without developer resources.  
Hello, 

I'm trying to render a visualforce page based on a value passed from another record.  The Custom Button URL i'm using to open the VF page is:
/apex/AvailableInstructors?id={!Lesson__c.Id}&Date_c={!Lesson__c.Lesson_Date__c}


and rendering the records using the following:
 
<apex:pageblocktable value="{!schedules}" var="s" columns="13" rendered="{!Schedule_Availability__c.Date__c== DATEVALUE($CurrentPage.parameters.Date__c)}" >
The VF page is showing all records and not rendering it based on the date value passed.  Any help would be appreciated!

Thanks!
Hello, 

I'm trying to render a visualforce page based on a value passed from another record.  The Custom Button URL i'm using to open the VF page is:
/apex/AvailableInstructors?id={!Lesson__c.Id}&Date_c={!Lesson__c.Lesson_Date__c}


and rendering the records using the following:
 
<apex:pageblocktable value="{!schedules}" var="s" columns="13" rendered="{!Schedule_Availability__c.Date__c== DATEVALUE($CurrentPage.parameters.Date__c)}" >
The VF page is showing all records and not rendering it based on the date value passed.  Any help would be appreciated!

Thanks!
Hello, 

I'm hoping it's possible to pass parameters to a flow using URLFOR and a custom button.  I've created a VF page to list instructors available on a specific lesson day by passing the parameters of the lesson record ID , and the Lesson date within the url of the VF page button.  Then created custom buttons to fire a Flow to "assign" or update the instructor on the lesson record.  My first attempt using <param name= 'name'> to pass the varInstructorId and the varLessonId was not working, so i'm trying to pass the parameters within the URLFOR command.

VF Page:
<apex:page standardcontroller="Schedule_Availability__c" recordSetVar="schedules" showHeader="FALSE" sidebar="False">
<apex:messages />
      <!-- CSS -->
  <style>
    .lead {
      color: green; 
      font-weight: bold;    
    }
    .assist {
      color:red;
      font-weight: bold; 
    }
  </style>
    <apex:form id="theForm">
        <apex:pageblock mode="maindetail"  title="{!$ObjectType.Schedule_Availability__c.label} for {!DATEVALUE($CurrentPage.parameters.Lesson__c.Lesson_Date__c)} "> 
            
            <apex:outputpanel id="Available">
                <apex:pageblocktable value="{!schedules}" var="s" columns="13" rendered="{!Schedule_Availability__c.Date__c= DATEVALUE($CurrentPage.parameters.Lesson__c.Lesson_Date__c)}" >
                    <apex:Column styleClass="header" headervalue="Instructor" value="{!s.Instructor_Volunteer__c}"/>
                     <apex:Column value="{!s.Discipline__c}"/>
                    <apex:Column styleClass="lead" Headervalue="Lead Skills" value="{!s.Lead_Instructor_Skills__c }" style="color:green"/>
                    <apex:Column styleClass="assist" Headervalue="Asst Skills" value="{!s.Assistant_Instructor_Skills__c}" style="color:red"/>
                    <apex:Column value="{!s.Date__c}"/>
                    <apex:Column value="{!s.Job_Roles__c}"/>
                    <apex:Column headervalue="AM" value="{!s.Booked_AM__c}"/>
                    <apex:Column headervalue="PM" value="{!s.Booked_PM__c}"/>                  
                    <apex:column headervalue="Eve" value="{!s.Booked_Evening__c}"/> 
                    <apex:column headervalue="Lead Instr.">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Lead_Instructor,Id,[varInstructorId='s.Instructor_Volunteer__c', varLessonId='$CurrentPage.parameters.id'])}" id="assign" value="Assign Lead"/>           
                    <!--<apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"/>
                    <apex:param name="varLessonId" value="{!Id}"/>-->
                    </apex:column>
                    <apex:column headervalue="Asst 1">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst1" value="Assign Asst 1"/>
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />        
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                    <apex:column headervalue="Asst 2">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst2" value="Assign Asst 2"/>           
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />  
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                    <apex:column headervalue="Asst 3">   
                    <apex:commandButton action="{!URLFOR($Action.Lesson__c.Assign_Asst_1, Id)}" id="asst3" value="Assign Asst 3"/>           
                    <apex:param name="varInstructorId" value="{!s.Instructor_Volunteer__c}"   />  
                    <apex:param name="varLessonId" value="{!Id}"/>
                    </apex:column>
                </apex:pageblockTable>
        <apex:panelGrid columns="3">
          <apex:commandButton action="{!previous}" value="Previous"/>
          <apex:commandButton action="{!next}" value="Next" />
          <apex:commandButton action="{!cancel}" value="Close Window" />
        </apex:panelGrid>
            </apex:outputpanel>
        </apex:pageblock>
    </apex:form>
      

</apex:page>

Custom Button:
/apex/AvailableInstructors?id={!Lesson__c.Id}&Date_c={!Lesson__c.Lesson_Date__c}

There are a few other issues i'm having with this page, but the most critical is inserting the Instructor__c onto the Lesson Record.  I'm trying  to stay away from apex, since this will need to be maintained by a non-profit without developer resources.