• Néstor Velázquez Sánchez
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Experiencias XCARET


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hi, I have a big problem. 

I have an OptionList, this OptionList come from a bigest query: 
 
/* CONTROLLER */
optiones = [SELECT someFields myField__r.RecordTypeId FROM myCustomObject__c WHERE (myField__r.RecordTypeId=: RTPersonalProduct2 OR myField__r.RecordTypeId=: RTMusicProduct2) AND myField__c IN: theList AND otherField__c NOT IN: mapAssetsProduct.keySet() AND myField__c NOT IN (SELECT myField__c FROM Booking__c WHERE ((dateStart__c >=: listDates1) AND (Fecha_fin__c <=: listDates2)) AND (hour__c	IN: hourStarList AND hour2__c IN: hourFinalList) )];


for(object__c r: optiones)
{
options.add(new SelectOption (r.myField__c, r.Product__r.Name));
}


/* Visual Force Page */
<apex:selectList value="{!asset.substituto}" size="1" multiselect="false" >
    <apex:selectOption itemLabel="-- SELECCIONA UN SUSTITUTO --" itemValue="" />
    <apex:selectOptions value="{!options}" />                              
</apex:selectList>


Where asset.substituto is a Map:   Map<String, List<>> ​ 

 

The issue is: I want use an selectList ONLY for a RecordType = RTPersonalProduct2 and display other selectList for the RecordType = RTInstrumentosProduct2 

 

I don't kwon how use the values or the fields to use one or other list, I only get a bigest list with all elements. 

 

If you know how access to the System.SelectOption to manipulate the option value elements, please help me. 

It's really simple if something then whatever but in the visual force it's not possible or I don't know how. 

Hi, I have a big and dynamic form, I don't care if the inputs come from list or objects or variables { set; get; } in the controllers, that's irrelevant, My only need is to send via POST and receive the input inputs from Visual Force Pace to a method that stores the received fields in objects.

I try use this part but don't working: 
<apex:pageBlock >
        <apex:form id="saveNewBooking">
            <apex:pageBlock >
                <apex:pageBlockButtons location="bottom" >
                    <apex:commandButton action="{!saveNewBooking}" value="Aceptar" style="width:135px; height: 30px; float: right;" />
                    <apex:commandButton value="Cancelar" style="width:135px; height: 30px; float: right;"/>
                </apex:pageBlockButtons>
            </apex:pageBlock>
            <apex:repeat value="{!opportunityProducts}" var="product">
                <!-- vamos a meter el for de los productos -->
                <apex:inputHidden id="fechaInicioNueva" value="{!product.Fecha_de_Inicio__c}"/>
                <apex:inputHidden id="fechaFinalNueva" value="{!product.Fecha_finalb__c}"/>

				<apex:inputHidden id="horaInicioNueva" value="{!product.Hora_de_Inicio__c}"/>
                <apex:inputHidden id="horaFinalNueva" value="{!product.Hora_Final__c}"/>
                
                <apex:inputHidden id="ProductId" value="{!product.Product2.Id}"/>

                
                <apex:pageBlock >
                    <h2>
                        Producto: {!product.Product2.Name}
                    </h2>

                    <apex:dataTable value="{!mapAssetsProduct[product.Product2.Id]}" rendered="{!if(CONTAINS(keysProducts,product.Product2.Id),true,false)}" var="asset" styleClass="tableClass">
                        
                        <apex:facet name="header">Activos</apex:facet>
                        
                        <apex:column >
                            <apex:facet name="header">Id relación</apex:facet>
                            <apex:outputText value="{!asset.Id}"/>
							<apex:inputHidden id="Id" value="{!asset.Id}"/> <!-- El id de la relacion -->
                        </apex:column>
                        
                        <apex:column >
                            <apex:facet name="header">Nombre</apex:facet>
                            <apex:outputText value="{!asset.Activo__r.Name}"/> - <apex:outputText value="{!asset.Activo__c}"/>
                        </apex:column>
                                               
                        <apex:column >
                            <apex:facet name="header">Actividad</apex:facet>
                            <apex:outputText value="{!IF(asset.Actividad__c == '', 'No especificada', asset.Actividad__c)}" />
                        </apex:column>
                        
                        <apex:column id="disponibilidad">
                            
                            <apex:facet name="header">Disponibilidad</apex:facet>

                            <apex:repeat value="{!bookings}" var="a">
                                <apex:variable var="disponibles" value="{!IF(a['A'] == asset.Activo__c, '1', '0')}" />
                                <apex:outputText rendered="{!IF(disponibles == '1', true, false)}" >
                                    <span class="{!IF(disponibles == '1', 'errorSmall', 'dispSmall')}">
                                        No disponible </span><br/>
                                        
                            		<apex:variable value="{!IF(asset.Activo__r.Tippo_del_activo__c == 'Interno', 'SI','NO')}" var="interno" />
                                    <apex:outputText rendered="{!IF(interno == 'SI', true, false)}">
                                        <select name="Activo" id="Activo" class="excluyent-select">
                                            <option value="">- - Selecciona un sustituto - - </option>
                                            <apex:repeat var="actvs" value="{!assetAbilities}">
                                                <apex:outputText rendered="{!IF(actvs.Actividad__c == asset.Actividad__c, true, false)}">
                                                    <option value="{!actvs.Activo__c}">{!actvs.Activo__r.Name} - {!actvs.Actividad__c}</option>
                                                </apex:outputText>
                                            </apex:repeat>
                                        </select>
										
                                    </apex:outputText>
                                </apex:outputText>
                            </apex:repeat>
                        </apex:column>
                    </apex:dataTable>
                </apex:pageBlock>
            </apex:repeat>
            <apex:pageBlock >
                <apex:pageBlockButtons location="bottom" >
                    <apex:commandButton action="{!saveNewBooking}" value="Aceptar" style="width:135px; height: 30px; float: right;" />
                    <apex:commandButton value="Cancelar" style="width:135px; height: 30px; float: right;"/>
                </apex:pageBlockButtons>
            </apex:pageBlock>
        </apex:form>
    </apex:pageBlock>


In the method I don't have nothing, how i can get the values of the inputs? In the LOG I  don't have nothing. 

 

I need your help with a new doubt with a custom controller.
In my VisualForce page I have to SelectList, these SelectList could change their name periodically (they are dynamic) in some times I have only one, but sometime I have 10 or more.
Then my SelectList have a name like:
<select name="{!var.Name_{!var.Id}" id="{!var.Name_{!var.Id}">
  <apex:repeat var="opt" value="options">
   <option value="{!opt.Id}>{!opt.Name}</option>
  </apex:repeat>
  </select>


This SelectList could be repeat N times, the form looks like the attachment image.

Multiple form inputs and hidden inputs, dynamic

How I can recieve this values in the custom controller to insert in my object Custom__c.

It's important considering that the code

ApexPages.currentPage().getParameters().get('input')

 is useless there, I have a lot input fields with distinct names,and not all the time will be the same name.


Thanks.

 

 

I need your help with a new doubt with a custom controller.
In my VisualForce page I have to SelectList, these SelectList could change their name periodically (they are dynamic) in some times I have only one, but sometime I have 10 or more.
Then my SelectList have a name like:
<select name="{!var.Name_{!var.Id}" id="{!var.Name_{!var.Id}">
  <apex:repeat var="opt" value="options">
   <option value="{!opt.Id}>{!opt.Name}</option>
  </apex:repeat>
  </select>


This SelectList could be repeat N times, the form looks like the attachment image.

Multiple form inputs and hidden inputs, dynamic

How I can recieve this values in the custom controller to insert in my object Custom__c.

It's important considering that the code

ApexPages.currentPage().getParameters().get('input')

 is useless there, I have a lot input fields with distinct names,and not all the time will be the same name.


Thanks.

 

 

Error says Challenge not yet complete... here's what's wrong: 
You do not have the correct account fields in the 'New Detailed Account' publisher action

Trailhead Challenge says
Add the Account Name, Type, Rating and Fax fields to the compact layout.

What am I doing wrong?

User-added image
Thanks!
Aron