• VenkataRamanjaneyulu Kattamuru
  • NEWBIE
  • 64 Points
  • Member since 2018
  • Mr
  • TCS

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hi,

Just  now , I saw that lightning input tag is accepting a character called "e" evenhough type is a number.
May be there is a bug in this component.
 
<lightning:input type="number" name="number" label="Number" />

Thanks&Regards,
Venkat Kattamuru.
 
My requirement is to add 7 remove
Hi all, 
when i was trying to remove theoptions which selected  I am unable to do anything(even logs are not coming in that method).
Please help ,

My code is shown below:

Apex-Class::

public class RealTimeSoql {
    public List<SelectOption> dropdowns {set;get;}
    public List<String> selectedoptions {set;get;}
    
    public Set<selectOption> displayList {set;get;}
    public List<string> removeList {set;get;}
    
    public  RealTimeSoql(){
        dropdowns         = new List<SelectOption>();
        selectedoptions = new List<String>();
        displayList        = new Set<selectOption>(); 
        removeList        = new List<string>();
        
        List<String> fields = new List<String>{'Name','Phone','Industry','Rating'};
            for(String s: fields){
                Selectoption sop = new SelectOption(s,s);
                dropdowns.add(sop);
            }
    }
    
    public void addOptions(){
        for(String s:selectedoptions){
            Selectoption dop = new SelectOption(s,s);
            displayList.add(dop);
        }
    }
    public void removeOptions(){
        System.debug('removeList:=============>'+ removeList);
        for(string s:removeList){
            Integer indexOfstring = selectedoptions.indexOf(s);
            String removed = selectedoptions.remove(indexOfstring);
        }
        System.debug('selectedoptions after remove:=============>'+ selectedoptions);
        addOptions();
        
    }

}

********************************************************************************************************
VFPage:

<apex:page controller="RealTimeSoql">
    <apex:form >
        <style>
            .box{
            width : 200px;
            height: 100px;
            }
        </style>
        <apex:pageBlock >
            
            <apex:selectList value="{!selectedoptions}" multiselect="true" styleClass="box">
                <apex:selectOptions value="{!dropdowns}"/>
            </apex:selectList>&nbsp;&nbsp;&nbsp;&nbsp;
            
            <apex:commandButton value="add"     action="{!addOptions}"/>    &nbsp;&nbsp;&nbsp;&nbsp;
              <apex:commandButton value="remove"  action="{!removeOptions}"/>    &nbsp;&nbsp;&nbsp;&nbsp; 
            
            <apex:selectList multiselect="true" styleClass="box" value="{!removeList}"   >
                <apex:selectOptions value="{!displayList}"/>
            </apex:selectList>    
             
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
I am getting this error ,while i was fetching data from Account sobject using dynamic query based on option selected by the user.
**********************************************************************Apex class ****************************************************************************
public class Dyanmic1 {
    
    public List<SelectOption>     options     {set;get;}
    public List<String>         selected     {set;get;}
    public List<Account>         accounts     {set;get;}
    public Dyanmic1(){
        options  = new List<SelectOption>();
        selected = new List<String>();
        accounts  = new List<Account>();
        List<String> fields = new List<String>{'Name','Industry','Rating','Phone'};
            for(String s : fields){
                SelectOption sop = new SelectOption(s,s);
                options.add(sop);
            }
        
    }
    public void go(){
        String query= 'Select ID';
        for(String s: selected){
            query = query+','+ s ;
            
        }
        query = query+'FROM Account';
        accounts = Database.query(query);
    }
    
}
*************************************************************VF Page*******************************************************************************
<apex:page controller="Dyanmic1">
    <apex:form>
    <apex:selectList multiSelect="true" value="{!selected}" >
        <apex:selectOptions value="{!options}" />
    </apex:selectList>
    <apex:commandButton value="Go" action ="{!go}"/>
    <apex:pageBlock>
    <apex:dataTable value="{!accounts}" var="a">
        <apex:repeat value="{!selected}" var="f">
            <apex:column value="{!a[f]}"/>
        </apex:repeat>
    </apex:dataTable> 
   </apex:pageBlock>
   </apex:form>
</apex:page>
***********************************************************************************************
Please help.
Thanks in advance,
Venkat.
 
Hi,

Just  now , I saw that lightning input tag is accepting a character called "e" evenhough type is a number.
May be there is a bug in this component.
 
<lightning:input type="number" name="number" label="Number" />

Thanks&Regards,
Venkat Kattamuru.
 
https://trailhead.salesforce.com/content/learn/modules/lex_dev_lc_basics/lex_dev_lc_basics_forms

The message is "Challenge not yet complete in My Trailhead Playground 1. The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.".

I have reviewed all the answers related to this issue but still can't figure it out.

 
My requirement is to add 7 remove
Hi all, 
when i was trying to remove theoptions which selected  I am unable to do anything(even logs are not coming in that method).
Please help ,

My code is shown below:

Apex-Class::

public class RealTimeSoql {
    public List<SelectOption> dropdowns {set;get;}
    public List<String> selectedoptions {set;get;}
    
    public Set<selectOption> displayList {set;get;}
    public List<string> removeList {set;get;}
    
    public  RealTimeSoql(){
        dropdowns         = new List<SelectOption>();
        selectedoptions = new List<String>();
        displayList        = new Set<selectOption>(); 
        removeList        = new List<string>();
        
        List<String> fields = new List<String>{'Name','Phone','Industry','Rating'};
            for(String s: fields){
                Selectoption sop = new SelectOption(s,s);
                dropdowns.add(sop);
            }
    }
    
    public void addOptions(){
        for(String s:selectedoptions){
            Selectoption dop = new SelectOption(s,s);
            displayList.add(dop);
        }
    }
    public void removeOptions(){
        System.debug('removeList:=============>'+ removeList);
        for(string s:removeList){
            Integer indexOfstring = selectedoptions.indexOf(s);
            String removed = selectedoptions.remove(indexOfstring);
        }
        System.debug('selectedoptions after remove:=============>'+ selectedoptions);
        addOptions();
        
    }

}

********************************************************************************************************
VFPage:

<apex:page controller="RealTimeSoql">
    <apex:form >
        <style>
            .box{
            width : 200px;
            height: 100px;
            }
        </style>
        <apex:pageBlock >
            
            <apex:selectList value="{!selectedoptions}" multiselect="true" styleClass="box">
                <apex:selectOptions value="{!dropdowns}"/>
            </apex:selectList>&nbsp;&nbsp;&nbsp;&nbsp;
            
            <apex:commandButton value="add"     action="{!addOptions}"/>    &nbsp;&nbsp;&nbsp;&nbsp;
              <apex:commandButton value="remove"  action="{!removeOptions}"/>    &nbsp;&nbsp;&nbsp;&nbsp; 
            
            <apex:selectList multiselect="true" styleClass="box" value="{!removeList}"   >
                <apex:selectOptions value="{!displayList}"/>
            </apex:selectList>    
             
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
I am getting this error ,while i was fetching data from Account sobject using dynamic query based on option selected by the user.
**********************************************************************Apex class ****************************************************************************
public class Dyanmic1 {
    
    public List<SelectOption>     options     {set;get;}
    public List<String>         selected     {set;get;}
    public List<Account>         accounts     {set;get;}
    public Dyanmic1(){
        options  = new List<SelectOption>();
        selected = new List<String>();
        accounts  = new List<Account>();
        List<String> fields = new List<String>{'Name','Industry','Rating','Phone'};
            for(String s : fields){
                SelectOption sop = new SelectOption(s,s);
                options.add(sop);
            }
        
    }
    public void go(){
        String query= 'Select ID';
        for(String s: selected){
            query = query+','+ s ;
            
        }
        query = query+'FROM Account';
        accounts = Database.query(query);
    }
    
}
*************************************************************VF Page*******************************************************************************
<apex:page controller="Dyanmic1">
    <apex:form>
    <apex:selectList multiSelect="true" value="{!selected}" >
        <apex:selectOptions value="{!options}" />
    </apex:selectList>
    <apex:commandButton value="Go" action ="{!go}"/>
    <apex:pageBlock>
    <apex:dataTable value="{!accounts}" var="a">
        <apex:repeat value="{!selected}" var="f">
            <apex:column value="{!a[f]}"/>
        </apex:repeat>
    </apex:dataTable> 
   </apex:pageBlock>
   </apex:form>
</apex:page>
***********************************************************************************************
Please help.
Thanks in advance,
Venkat.
 
Hi All,

Can anyone please help me with bellow challenge.


Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).The Apex trigger must be called 'AccountAddressTrigger'.
The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.
With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.

For above challenge i tried with following code but looks like it doesnt mach the requirement.

trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c = true) {
            /*ShippingPostalCode = BillingPostalCode;*/
        }   
    } 

}

Please help me