• chuckwalley
  • NEWBIE
  • 29 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 8
    Replies

I'm using a shopping cart scenario to pick products. When a product is selected, it is moved into a shopping cart list. Each product has different options (ie "Size," Zone.") depending upon the product. When I select the product and pull into the shopping cart, I want to provide a dynamic dropdown showing only the sizes and zones for the specific product. 

 

Now, when I do this, if I pick two products, then I get all options for both products appearing in the picklists. I know I'm loading into one whole array, so I'm thinking I should create a list<list<SelectOption>> for each option, but I'm not sure how to keep it in sync on the VF page. That is, when I'm showing the first product, how do I convey I want to show the first list<SelectOption>? 

 

Or - and I completely off base and should I submit a job application at McDonalds? 

I'm looking for a way to keep my ServiceDate, from the Opportunity Line Item synchronized with the earliest ScheduleDate from the OpportunityLineItemSchedule. 

 

Triggers cannot be written to OpportunityLineItemSchedule, so, it looks as though I'm forced to do something through the UI. However, the out of the box schedule interface cannot be modified. 

 

Do I need to rewrite the schedule interface? Is there some other witty solution? 

Is there a way to validate the ScheduleDate from the OpportunityLineItemSchedule object, other than creating a VF page. My current process calls /oppitm/scheduleedit.jsp, but I have no idea how to manipulate (or validate) the data associated with that jsp. 

 

thanks, 

 

Chuck

How do I get the row number back from my PageBlockTable with javascript or jQuery? I’ve tried a few methods, but they always return [object Object].

 

I am displaying repeating elements in a PageBlockTable. When I change the contents of Field1, I want to perform a calculation in my controller, and place the cursor in Field2.

 

Yes, I know the scripting looks like I'm lost - I am. 

 

<apex:page controller="TestTabbingController" id="PageId">

<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.8.2.min.js')}"  />
<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.8.24.custom.min.js')}"  />
<apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.8.24.custom.css')}"  />


<script type="text/javascript">
	  j$ = jQuery.noConflict();
	  
	  function putErThereDude()
	  {
	  
         var myRow = j$('[id*=PageBlockTableId]');
		 alert("myRow is " + myRow) ; 
			   
	     var Part1 = "PageId:FormId:PageBlockId:PageBlockSectionId:PageBlockTableId:";
		 var myRow = j$('[id*=PageBlockTableId]');
		 var Part3 = ":Field2" ; 
		   
		 var PutIt = Part1 + myRow + Part3; 
		 alert("PutIt is " + PutIt) ; 
		   
		 var myElement = document.getElementById(PutIt);
         alert("myElement is " + myElement) ; 
           
         j$(myElement).focus();		   
	  
	  }


</script>

   <apex:form id="FormId">
      
      
      <apex:PageBlock title="Confirmation" id="PageBlockId">  
     
      
         <apex:PageBlockSection title="GPS Print Products" id="PageBlockSectionId" columns="1" >

               
               <apex:pageBlockTable value="{!OpportunitiesWithIndex}" var="oppWrapped" style="width:100%" id="PageBlockTableId">
               
                
                    <apex:column headerValue="Name" Id="GPSD_Name">
                        <apex:outputLabel value="{!oppWrapped.opp.name}"                 id="Name" >     
                        </apex:outputLabel>                        
                    </apex:column>

                    <apex:column headerValue="Field 1" Id="GPSD_Field1">
                        <apex:inputField value="{!oppWrapped.opp.X_Field_1__c}"          id="Field1" >
                            
                            <apex:actionSupport event="onchange" action="{!doSomething}" reRender="PageBlockSectionId" oncomplete="putErThereDude(event.target.focus())" />
                        </apex:inputField>                           
                    </apex:column>     


                    <apex:column headerValue="Field 2" Id="GPSD_Field2">
                        <apex:inputField value="{!oppWrapped.opp.X_Field_2__c}"          id="Field2" >     
                           <apex:actionSupport event="onchange" action="{!doSomething}" reRender="PageBlockSectionId" />   
                        </apex:inputField>                         
                    </apex:column>

                    <apex:column headerValue="Field 3" Id="GPSD_Field3">
                        <apex:inputField value="{!oppWrapped.opp.X_Field_3__c}"          id="Field3" >     
                           <apex:actionSupport event="onchange" action="{!doSomething}" reRender="PageBlockSectionId" />     
                        </apex:inputField>                         
                    </apex:column>

                    
                    <apex:column headerValue="Field 4" Id="GPSD_Field4">
                        <apex:inputField value="{!oppWrapped.opp.X_Field_4__c}"          id="Field4" >       
                           
                        </apex:inputField>                         
                    </apex:column>
                    
               
                
                
                </apex:pageBlockTable>
                
                


         </apex:PageBlockSection>
        
      </apex:PageBlock>
      
 
   </apex:form>
</apex:page>

 

I am working on a VF page and want to control the cursor after I call the calcRevenue method in the controller. Currently, when the panel refreshes, the cursor is stuck at the upper left-hand of the screen. I want to tab through each field, change values, if necessary, then tab to the next field. I figure there is some javascript involved, but I'm not sure how to invoke it. 

 

Any help would be greatly appreciated. I'll even buy you a beer. 

 

<apex:outputPanel Id="GPS_Print_Area">
 <apex:PageBlockSection title="GPS Print Products" id="schedulePrintProducts_GPSD" columns="1" rendered="{!is_GPS_Distribution_OppRecType}" >
  <apex:pageBlocktable value="{!schedulePrintArray}" var="e_GPSD" style="width:100%" >
				
   <apex:column headerValue="Product"  >
    <apex:outputText styleClass="myClass"  value="{!e_GPSD.iProdName}" />
   </apex:column>
   <apex:column headerValue="Rate/Copy" Id="GPSD_RateCopy">
    <apex:inputField value="{!e_GPSD.iOLI.Rate__c}">
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area">
     </apex:actionSupport>
    </apex:inputField>                         
   </apex:column>
   <apex:column headerValue="Avg Copies/Pub Day" Id="GPSD_AvgCopies">
    <apex:inputField value="{!e_GPSD.iOLI.AvgUnits__c}" >
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
    </apex:inputField>
   </apex:column>

   <apex:column headerValue="# Pub Days/Year" Id="GPSD_PubDays" >
    <apex:inputField value="{!e_GPSD.iOLI.DaysInTimePeriod__c}" >
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
   </apex:inputField>
  </apex:column>

  <apex:column headerValue="Contract Duration (Months)" Id="GPSD_Duration" >
   <apex:inputField value="{!e_GPSD.iOLI.Contract_Duration_Months__c}" >
    <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
   </apex:inputField>
  </apex:column>

  <apex:column headerValue="Projected Revenue" Id="GPSD_Revenue" >
   <apex:inputField value="{!e_GPSD.iOLI.UnitPrice}" >
						   
   </apex:inputField>
  </apex:column>
					
  <apex:column headerValue="Override" >
   <apex:inputField value="{!e_GPSD.iOLI.UnitPriceIsOverridden__c}" />
  </apex:column>					

  <apex:column headerValue="Start Date">
   <apex:inputField value="{!e_GPSD.iOLI.ServiceDate}" required="false" />
  </apex:column>

  

	
  </apex:pageBlocktable>
 </apex:PageBlockSection>
</apex:outputPanel>

 

Thanks, 

 

Chuck

 

I'm running Eclipse 3.6.2 with the 25.0.0.20120618021 version of the Force.com IDE plugin. I cannot see error messages while developing VF Pages. Therefore, I have to cut and paste into the Salesforce app's window to see where my error resides. Has anyone else had this problem and are there any suggestions for fixing? 

 

Thanks, 

 

Chuck

Is there a way to remove sidebars and headers within an iframe? I have a customized Opportunity page and I want to see the Opportunity shares. I can do this with an iframe, however, I could do without the header and sidebar. 

 

Thanks

 

I'm working wtih a previously developed and customized VF Opportunity page, which has a tabbed interface. My goal is to add a tab which replicate the process that allows a user to see the shares associated with an Opportunity. The catch is, the OpportunityShare has a field called UserOrGroupId, which requires a little more logic than just grabbing the name associated with the ID. 

 

Therefore, I'm trying to present a list of shares containing the Derived Name along with the AccessLevel and RowCause coming directly from a query. 

 

To capture the name, I created a list, along with a getter method to populate it. I have a separate getter method to populate the OpportunityShare info. 

 

The Apex side seems to be working fine, returning both lists. However, I'm having a problem finding a way to mix the two. I've resorted to using the <apex:repeat> component, but cannot do so because it is within a pageBlock. 

 

 

<apex:tab label="Who can see this opportunity" style="background-color:white; border-top-color:#DDB929; vertical-align: middle;">

	<apex:pageblock id="OpportunityShares" mode="maindetail">
		<apex:pageblockbuttons location="Top">

			<apex:commandButton action="{!YabaDabaDo}" value="Yaba Daba Doo"/>

		</apex:pageblockbuttons>

		<apex:pageBlockSection columns="1" Title="Opportunity Shares" collapsible="false">
			<apex:outputpanel rendered="{!OpportunityShares.size=0}" layout="block" style="border: 1px solid #D4DADC; padding: 5px 2px 4px 5px;">
				<apex:outputtext value="No records to display"/>
			</apex:outputpanel>

			<apex:pageblockTable value="{!OpportunityShares}" var="os" rendered="{!OpportunityShares.size>0}">

				<!-- 
				<apex:column headerValue="Action" width="30px">
					<b>
						<apex:outputLink value="{!URLFOR($Action.OpportunityShare.Delete, os.id, [retURL=URLFOR($Action.Opportunity.View, opportunity.Id)], true)}">Delete</apex:outputLink>

					</b>
				</apex:column>
				-->
                
				<apex:column headerValue="Person or Group ID" >
					<apex:outputtext value="{!os.UserOrGroupId}" />  
				</apex:column>
				
				
				<apex:repeat value="{!ListOfRealNames}" var="theName" id="allNames" />
				<apex:column headerValue="Name" >
   				   <apex:outputtext value="{!ListOfRealNames[0]}" id="oneName" />  
				</apex:column>				
             
                
				<apex:column headerValue="Access Level" >
					<apex:outputtext value="{!os.OpportunityAccessLevel}"/>
				</apex:column>

				<apex:column headerValue="Reason" >
					<apex:outputtext value="{!os.RowCause}"/>
				</apex:column>

			</apex:pageblockTable>
		</apex:pageBlockSection>

</apex:pageblock>
</apex:tab>

 

ListOfNames is the area in which I'm stummped. I do know I'm getting the entire list back -- I just don't know how to output the darn items. 

 

Am I pointed in the right direction or just flapping in the wind? Can I mix the two lists in this way and if so, can you please provide a clue to the stumped. 

 

 

 

I am building a dynamic picklist and cannot get the second picklist to rerender.

 

this is my page

<h1>THIS IS WHERE THE PROBLEM EXISTS</h1>
		
<apex:outputpanel id="USAT" rendered="{!isWeekend = false}">
  <apex:outputpanel >
   <apex:pageBlockSection columns="1">
     <apex:pageblockSectionItem >
         <apex:outputLabel value="Sales Team:" for="SalesTeam"/>
          <apex:selectList value="{!vChosenSalesTeam}" id="SalesTeamList" required="true" multiselect="false" size="1"  >
             <apex:selectOptions value="{!SalesTeams}"/>
             <apex:actionSupport event="onchange"  action="{!getTeamMembers}"  rerender="USAT" />
           </apex:selectList>
     </apex:pageblockSectionItem>	
				
     <apex:pageblockSectionItem >
       <apex:outputLabel value="Team Member:" for="TeamMembers"/>
         <apex:selectList id="TeamMemberList"  value="{!vChosenSalesPerson}" required="true" multiselect="false" size="1"  >
	   <apex:selectOptions value="{!TeamMembers}"/>
	 </apex:selectList>
     </apex:pageblockSectionItem>					
		 	
    </apex:pageBlockSection>
  </apex:outputpanel>
</apex:outputpanel>

 

this is the method in my controller

 

    public pageReference  getTeamMembers()
    
    {
       
       list<SelectOption> TeamMembers = new list<SelectOption>();
       
       TeamMembers.add(new SelectOption('- None -', '- None -')); 
       
          for (User UList : 
             [SELECT Id, Name
              FROM   User
              WHERE  Sales_Team__c = :vChosenSalesTeam
              AND    Sales_Team__c != null  
              AND    IsActive = true
              AND    AMS_Territory__c != null
              AND    Property__c in ('1531 - Republic Media', 'NST', 'USAT', 'USAT SPORTS', 'USA WEEKEND')   
              ORDER  BY Name
              LIMIT  125])
           {
             TeamMembers.add(new SelectOption(UList.Name, Ulist.Name));  
           }      

       return null;          
    } 

 Getters and Setters: 

 

     public boolean vIsClientCheckBox           {get; Set;}
     public boolean vIsDigitalAgencyCheckBox    {get; Set;}
     public boolean vIsPrintAgencyCheckBox      {get; Set;}
     public boolean vIsIntegratedSeller         {get; Set;}
     
     public string  vChosenSalesTeam            {get; Set;}
     public string  vChosenSalesPerson          {get; Set;} 
     public list<selectOption> TeamMembers      {get; Set;} 

 

The first picklist renders properly. The second -- nothing. My debug log shows the list is built. 

 

 

 

Any help is greatly appreciated. 

 

Thanks, 

 

Chuck

 



 

 

 

I'm trying to pass a dynamic picklist from my controller to my page. I've successfully used this technique in the past, but now, I get the following message:  

 

Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.ApexELResolver$VisualforceArrayList 

 

This is triggered by  event="onchange"  action="{!getTeamMembers}" in the section of code associated with the "Sales Team" output label. 

 

The page code is: 

 

<apex:pageblockSectionItem >
     <apex:outputLabel value="Sales Team:" />
     <apex:selectList value="{!vChosenSalesTeam}" multiselect="false" size="1"  >
         <apex:selectOptions value="{!SalesTeams}"/>
         <apex:actionSupport event="onchange"  action="{!getTeamMembers}" rerender="USAT" />
     </apex:selectList>
</apex:pageblockSectionItem>

<apex:pageblockSectionItem >
    <apex:outputLabel value="Team Member:" for="TeamMembers"/>
    <apex:selectList id="TeamMemberList"  value="{!vChosenSalesPerson}" multiselect="false" size="1"  >
        <apex:selectOptions value="{!TeamMembers}"/>
    </apex:selectList>
</apex:pageblockSectionItem>

 

The controller is: 

 

    Public list<selectOption> getTeamMembers()
    {
       
       System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0100'); 
     
       System.debug('#################### vChosenSalesTeam: ' + vChosenSalesTeam);  
       
       List<SelectOption> TeamMembers = new List<SelectOption>();
       
       TeamMembers.add(new SelectOption('- None -', '- None -')); 

           
       for (User UList : 
          [SELECT Id, Name
           FROM   User
           WHERE  Sales_Team__c = :vChosenSalesTeam
           AND    Sales_Team__c != null  
           AND    IsActive = true
           AND    AMS_Territory__c != null
           AND    Property__c in ('1531 - Republic Media', 'NST', 'USAT', 'USAT SPORTS', 'USA WEEKEND')   
           ORDER  BY Name
           LIMIT  125])
        {
         System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0200'); 
         System.debug('#################### UList.Id: '   + UList.Id);  
         System.debug('#################### UList.Name: ' + UList.Name);  
         
         System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0300'); 
         TeamMembers.add(new SelectOption(UList.Id, Ulist.Name));  
        }      
      
       System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0400');       
       return TeamMembers;
       //return null;
    } 
    

 

 

 

Any clues are greatly appreciated. 

 

Thanks,

 

Chuck

Not sure if I've lost my mind, but I keep getting an error message with this IF statement: 

if (indexOfString > zero)

 

The message is: Save error: Condition expression must be of type Boolean

 

What am I missing???

 

----------------------------------------------------

integer zero = 0;

string myDeveloperName = myUserRoleB.DeveloperName;
integer indexOfString = myDeveloperName.indexOf('_groupshare');

if (indexOfString > zero)
 {
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0600');
// turn switch to null and get out with UserRole.Id
myUserRoleParentRoleId = null;
myUserRoleId = myUserRoleB.Id;
}
else if (myUserRoleParentRoleId = null)
{
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0700');
// switch is null - get out with UserRole.Id
myUserRoleId = myUserRoleB.Id;
}

else
{
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0700');
// get next check ready and keep Parent Role Id active so we stay in the loop
myUserRoleParentRoleId = myUserRoleB.ParentRoleId;
myUserRoleId = myUserRoleB.ParentRoleId;
}

Hi, I want to return the record count of a dynamic SOQL query, (checkVal is passed in so don't worry about that):

 

Public List<sObject> lstObj;

Public Integer totRecsToProcess;


mystr  = '[select count() from payout__ImportStaging__c where payout__BD_Id__c = \'' + String.escapeSingleQuotes(checkVal) ;

 lstObj = Database.query(mystr);

 

I want to set totRecsToProcess equal to the count() value returned, can someone please tell me the correct syntax for that?

 

Thanks.

 

 

 

 

Is there a way to validate the ScheduleDate from the OpportunityLineItemSchedule object, other than creating a VF page. My current process calls /oppitm/scheduleedit.jsp, but I have no idea how to manipulate (or validate) the data associated with that jsp. 

 

thanks, 

 

Chuck

I am working on a VF page and want to control the cursor after I call the calcRevenue method in the controller. Currently, when the panel refreshes, the cursor is stuck at the upper left-hand of the screen. I want to tab through each field, change values, if necessary, then tab to the next field. I figure there is some javascript involved, but I'm not sure how to invoke it. 

 

Any help would be greatly appreciated. I'll even buy you a beer. 

 

<apex:outputPanel Id="GPS_Print_Area">
 <apex:PageBlockSection title="GPS Print Products" id="schedulePrintProducts_GPSD" columns="1" rendered="{!is_GPS_Distribution_OppRecType}" >
  <apex:pageBlocktable value="{!schedulePrintArray}" var="e_GPSD" style="width:100%" >
				
   <apex:column headerValue="Product"  >
    <apex:outputText styleClass="myClass"  value="{!e_GPSD.iProdName}" />
   </apex:column>
   <apex:column headerValue="Rate/Copy" Id="GPSD_RateCopy">
    <apex:inputField value="{!e_GPSD.iOLI.Rate__c}">
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area">
     </apex:actionSupport>
    </apex:inputField>                         
   </apex:column>
   <apex:column headerValue="Avg Copies/Pub Day" Id="GPSD_AvgCopies">
    <apex:inputField value="{!e_GPSD.iOLI.AvgUnits__c}" >
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
    </apex:inputField>
   </apex:column>

   <apex:column headerValue="# Pub Days/Year" Id="GPSD_PubDays" >
    <apex:inputField value="{!e_GPSD.iOLI.DaysInTimePeriod__c}" >
     <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
   </apex:inputField>
  </apex:column>

  <apex:column headerValue="Contract Duration (Months)" Id="GPSD_Duration" >
   <apex:inputField value="{!e_GPSD.iOLI.Contract_Duration_Months__c}" >
    <apex:actionSupport event="onchange" action="{!calcRevenue}" reRender="GPS_Print_Area" />
   </apex:inputField>
  </apex:column>

  <apex:column headerValue="Projected Revenue" Id="GPSD_Revenue" >
   <apex:inputField value="{!e_GPSD.iOLI.UnitPrice}" >
						   
   </apex:inputField>
  </apex:column>
					
  <apex:column headerValue="Override" >
   <apex:inputField value="{!e_GPSD.iOLI.UnitPriceIsOverridden__c}" />
  </apex:column>					

  <apex:column headerValue="Start Date">
   <apex:inputField value="{!e_GPSD.iOLI.ServiceDate}" required="false" />
  </apex:column>

  

	
  </apex:pageBlocktable>
 </apex:PageBlockSection>
</apex:outputPanel>

 

Thanks, 

 

Chuck

 

I'm running Eclipse 3.6.2 with the 25.0.0.20120618021 version of the Force.com IDE plugin. I cannot see error messages while developing VF Pages. Therefore, I have to cut and paste into the Salesforce app's window to see where my error resides. Has anyone else had this problem and are there any suggestions for fixing? 

 

Thanks, 

 

Chuck

Is there a way to remove sidebars and headers within an iframe? I have a customized Opportunity page and I want to see the Opportunity shares. I can do this with an iframe, however, I could do without the header and sidebar. 

 

Thanks

 

I'm working wtih a previously developed and customized VF Opportunity page, which has a tabbed interface. My goal is to add a tab which replicate the process that allows a user to see the shares associated with an Opportunity. The catch is, the OpportunityShare has a field called UserOrGroupId, which requires a little more logic than just grabbing the name associated with the ID. 

 

Therefore, I'm trying to present a list of shares containing the Derived Name along with the AccessLevel and RowCause coming directly from a query. 

 

To capture the name, I created a list, along with a getter method to populate it. I have a separate getter method to populate the OpportunityShare info. 

 

The Apex side seems to be working fine, returning both lists. However, I'm having a problem finding a way to mix the two. I've resorted to using the <apex:repeat> component, but cannot do so because it is within a pageBlock. 

 

 

<apex:tab label="Who can see this opportunity" style="background-color:white; border-top-color:#DDB929; vertical-align: middle;">

	<apex:pageblock id="OpportunityShares" mode="maindetail">
		<apex:pageblockbuttons location="Top">

			<apex:commandButton action="{!YabaDabaDo}" value="Yaba Daba Doo"/>

		</apex:pageblockbuttons>

		<apex:pageBlockSection columns="1" Title="Opportunity Shares" collapsible="false">
			<apex:outputpanel rendered="{!OpportunityShares.size=0}" layout="block" style="border: 1px solid #D4DADC; padding: 5px 2px 4px 5px;">
				<apex:outputtext value="No records to display"/>
			</apex:outputpanel>

			<apex:pageblockTable value="{!OpportunityShares}" var="os" rendered="{!OpportunityShares.size>0}">

				<!-- 
				<apex:column headerValue="Action" width="30px">
					<b>
						<apex:outputLink value="{!URLFOR($Action.OpportunityShare.Delete, os.id, [retURL=URLFOR($Action.Opportunity.View, opportunity.Id)], true)}">Delete</apex:outputLink>

					</b>
				</apex:column>
				-->
                
				<apex:column headerValue="Person or Group ID" >
					<apex:outputtext value="{!os.UserOrGroupId}" />  
				</apex:column>
				
				
				<apex:repeat value="{!ListOfRealNames}" var="theName" id="allNames" />
				<apex:column headerValue="Name" >
   				   <apex:outputtext value="{!ListOfRealNames[0]}" id="oneName" />  
				</apex:column>				
             
                
				<apex:column headerValue="Access Level" >
					<apex:outputtext value="{!os.OpportunityAccessLevel}"/>
				</apex:column>

				<apex:column headerValue="Reason" >
					<apex:outputtext value="{!os.RowCause}"/>
				</apex:column>

			</apex:pageblockTable>
		</apex:pageBlockSection>

</apex:pageblock>
</apex:tab>

 

ListOfNames is the area in which I'm stummped. I do know I'm getting the entire list back -- I just don't know how to output the darn items. 

 

Am I pointed in the right direction or just flapping in the wind? Can I mix the two lists in this way and if so, can you please provide a clue to the stumped. 

 

 

 

I'm trying to pass a dynamic picklist from my controller to my page. I've successfully used this technique in the past, but now, I get the following message:  

 

Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.ApexELResolver$VisualforceArrayList 

 

This is triggered by  event="onchange"  action="{!getTeamMembers}" in the section of code associated with the "Sales Team" output label. 

 

The page code is: 

 

<apex:pageblockSectionItem >
     <apex:outputLabel value="Sales Team:" />
     <apex:selectList value="{!vChosenSalesTeam}" multiselect="false" size="1"  >
         <apex:selectOptions value="{!SalesTeams}"/>
         <apex:actionSupport event="onchange"  action="{!getTeamMembers}" rerender="USAT" />
     </apex:selectList>
</apex:pageblockSectionItem>

<apex:pageblockSectionItem >
    <apex:outputLabel value="Team Member:" for="TeamMembers"/>
    <apex:selectList id="TeamMemberList"  value="{!vChosenSalesPerson}" multiselect="false" size="1"  >
        <apex:selectOptions value="{!TeamMembers}"/>
    </apex:selectList>
</apex:pageblockSectionItem>

 

The controller is: 

 

    Public list<selectOption> getTeamMembers()
    {
       
       System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0100'); 
     
       System.debug('#################### vChosenSalesTeam: ' + vChosenSalesTeam);  
       
       List<SelectOption> TeamMembers = new List<SelectOption>();
       
       TeamMembers.add(new SelectOption('- None -', '- None -')); 

           
       for (User UList : 
          [SELECT Id, Name
           FROM   User
           WHERE  Sales_Team__c = :vChosenSalesTeam
           AND    Sales_Team__c != null  
           AND    IsActive = true
           AND    AMS_Territory__c != null
           AND    Property__c in ('1531 - Republic Media', 'NST', 'USAT', 'USAT SPORTS', 'USA WEEKEND')   
           ORDER  BY Name
           LIMIT  125])
        {
         System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0200'); 
         System.debug('#################### UList.Id: '   + UList.Id);  
         System.debug('#################### UList.Name: ' + UList.Name);  
         
         System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0300'); 
         TeamMembers.add(new SelectOption(UList.Id, Ulist.Name));  
        }      
      
       System.debug('#################### USAT_GD_ShareRefPageExtension MilePost getTeamMembers-0400');       
       return TeamMembers;
       //return null;
    } 
    

 

 

 

Any clues are greatly appreciated. 

 

Thanks,

 

Chuck

Not sure if I've lost my mind, but I keep getting an error message with this IF statement: 

if (indexOfString > zero)

 

The message is: Save error: Condition expression must be of type Boolean

 

What am I missing???

 

----------------------------------------------------

integer zero = 0;

string myDeveloperName = myUserRoleB.DeveloperName;
integer indexOfString = myDeveloperName.indexOf('_groupshare');

if (indexOfString > zero)
 {
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0600');
// turn switch to null and get out with UserRole.Id
myUserRoleParentRoleId = null;
myUserRoleId = myUserRoleB.Id;
}
else if (myUserRoleParentRoleId = null)
{
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0700');
// switch is null - get out with UserRole.Id
myUserRoleId = myUserRoleB.Id;
}

else
{
System.debug('#################### ListHeirarchyRoles() MilePost getRolesToShare-0700');
// get next check ready and keep Parent Role Id active so we stay in the loop
myUserRoleParentRoleId = myUserRoleB.ParentRoleId;
myUserRoleId = myUserRoleB.ParentRoleId;
}