• Balkishan
  • NEWBIE
  • 70 Points
  • Member since 2010
  • Senior Technical Consultant
  • CloudCertitude


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 13
    Replies
I have a column that is a multi-select picklist. I would like to translate the semi-colons returned from SOQL to spaces before I display this value. How would I replace all the ';' with spaces?

Here is the part of my page that displays this column
        <aura:iteration items="{!v.territories}" var="t">
            <tr>
                <td>{!t.States__c}</td>
            </tr>
        </aura:iteration>

This currently looks like "AK;AL;AR;AZ;CA;CT;CT;DE;FL;GA;HI;IA;ID;IL;IN;KY"  which does not wrap well.
Regarding the Challenge "Create a Lightning Component to display Case information", under module "Using Apex in Components ",
'DisplayCaseController' Apex Class is written:
User-added image
But, the DisplayCase Component is not being saved, showing error that no such controller is found.
User-added image
So, can't complete the Challenge.
Can anyone help? Thanks in advance

Warm Regards,
Sourav

Hi,

I have been given an assignment. Which is as per follow:-

Create a VF page 
This page contains list of contacts.
By default these records are not editable.
Each record has a checkbox.
If user clicks on a checkbox, then corresponding record will become editable.
User can modify that reocrd
Like that user can select multiple records and can modify them.
After changes, save all only those records which are editable.
After saving the records refresh page and display updated record.
All checkboxes now should become unchecked.

I have create a VFpage and a controller for that but i unable to get desire output.Vf page code is as shown
<apex:page controller="BulkUpdateController">
<apex:form >
   <apex:actionFunction name="selectCheckBox" action="{!selectCheckBox}" rendered="block">
   <apex:param name="a" value="" assignTo="{!selectedCheckBox}"/>
   </apex:actionFunction>
    <apex:pageBlock >
     <table>
        <tr>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Email</th>
        </tr>
        <tr>
        <apex:repeat value="{!RecordList}" var="rec">
        <tr>
            <td><apex:inputText value="{!rec.FirstName__c}" disabled="true"/></td>
            <td><apex:inputText value="{!rec.LastName__c}" disabled="true"/></td>
            <td><apex:inputText value="{!rec.Email__c}" disabled="true"/></td>
            <td><apex:inputCheckbox value="{!rec.CheckIn__c}" onclick="select()"/></td>
        </tr>   
        </apex:repeat>
        </tr>
     </table>
        <apex:pageBlockButtons >
          <apex:commandButton value="Save" action="{!SaveMe}"/>
          <apex:commandButton value="Cancel" action="{!Cancel}"/>     
        </apex:pageBlockButtons>     
    </apex:pageBlock>
    <script>
       function select(){
         alert('hello');
         selectCheckBox(RecordList.value);
        }
    </script>
</apex:form>
</apex:page>

code for controller is

public class BulkUpdateController{
    public List<Student__c> RecordList{get;set;}
    public Boolean selectedCheckBox{get;set;}
       public BulkUpdateController(){
       RecordList = new List<Student__c>();
      
       RecordList = [SELECT FirstName__c, LastName__c, Email__c, checkIn__c FROM student__c];
    }
      public PageReference SaveMe(){
        upsert RecordList;
        // PageReference pg = new PageReference('/' + student.id);
        return null;
    }
   
     public PageReference Cancel(){
     pagereference pg = new pagereference('https://ap1.salesforce.com/home/home.jsp');
    return pg;
    }
    public PageReference selectCheckBox(){
    RecordList = new List<Student__c>();
    RecordList = [SELECT FirstName__c, LastName__c, Email__c, checkIn__c FROM student__c WHERE checkIn__c =: selectedCheckBox];
    return null;
    }
}
This is the code for page and controller.Am i coding in right way.please Help me if somebody can.

  How to select city in a picklist by selecting a state in another picklist?

 

    I have made an object called "State". There are three custom fields :

                                                                     1. State

                                                                     2. City

                                                                     3. Village

                                                                      in this object.

I have made  picklists for state, city and village . I want that whenever i select a state, city associated with this state got select. And also when i want that  whenever i select a city, Village associated with this city got select.If you have any solution please tell me.Thanks .

I have written code for that which is as follow:-

                                             For page

<apex:page controller="sampleCon">
<apex:form >
<apex:actionFunction name="Citysearch" action="{!getCities}" reRender="result" status="status1"/>
<apex:actionFunction name="Villagesearch" action="{!getVillages}" reRender="result" status="status2"/>

<apex:selectList value="{!State}" size="1" onclick="searchCity()" >
<apex:selectOptions value="{!items}" />
<apex:actionStatus startText="Searching..." stopText="Search Result" id="status1" >
</apex:actionstatus>
</apex:selectList>

<apex:selectList value="{!City}" size="1" onclick="searchVillage()">
<apex:selectOptions value="{!Cities}"/>
<apex:actionStatus starttext="searching..." stoptext="Search Complete" id="status2" >
</apex:actionStatus>
</apex:selectList>

<apex:selectList value="{!Village}" size="1">
<apex:selectOptions value="{!Villages}"/>
</apex:selectList>

</apex:form>
<script>
function searchCity(){
// alert('hiiiiiiiiiii');
getCities();
}
function searchVillage()
{
// alert('hello');
getVillages();
}
</script>
</apex:page>
For controller
public class sampleCon {
        String id;
        public StateCity__c State{get;set;}
        public StateCity__c City{get;set;}
        public StateCity__c Village{get;set;}
        
        public List<SelectOption> getItems() {
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Rajasthan'));
                    options.add(new SelectOption('id','MP'));
                    return options;
                    }
        
        public List<SelectOption> getCities() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Ajmer'));
                    options.add(new SelectOption('id','Bhopal'));
                    return options;
                    }
        
        public List<SelectOption> getVillages() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Kishangarh'));
                    options.add(new SelectOption('id','Nimach'));
                    return options;
                    }               
}

I have made an object called "State". There are three custom fields :

                                                                     1. State

                                                                     2. City

                                                                     3. Village

                                                                      in this object.

I have made  picklists for state, city and village . I want that whenever i select a state, city associated with this state got select. And also when i want that  whenever i select a city, Village associated with this city got select.If you have any solution please tell me.Thanks .

I have written code for that which is as follow:-

                                             For page

<apex:page controller="sampleCon">
<apex:form >
<apex:actionFunction name="Citysearch" action="{!getCities}" reRender="result" status="status1"/>
<apex:actionFunction name="Villagesearch" action="{!getVillages}" reRender="result" status="status2"/>

<apex:selectList value="{!State}" size="1" onclick="searchCity()" >
<apex:selectOptions value="{!items}" />
<apex:actionStatus startText="Searching..." stopText="Search Result" id="status1" >
</apex:actionstatus>
</apex:selectList>

<apex:selectList value="{!City}" size="1" onclick="searchVillage()">
<apex:selectOptions value="{!Cities}"/>
<apex:actionStatus starttext="searching..." stoptext="Search Complete" id="status2" >
</apex:actionStatus>
</apex:selectList>

<apex:selectList value="{!Village}" size="1">
<apex:selectOptions value="{!Villages}"/>
</apex:selectList>

</apex:form>
<script>
function searchCity(){
// alert('hiiiiiiiiiii');
getCities();
}
function searchVillage()
{
// alert('hello');
getVillages();
}
</script>
</apex:page>
For controller
public class sampleCon {
        String id;
        public StateCity__c State{get;set;}
        public StateCity__c City{get;set;}
        public StateCity__c Village{get;set;}
        
        public List<SelectOption> getItems() {
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Rajasthan'));
                    options.add(new SelectOption('id','MP'));
                    return options;
                    }
        
        public List<SelectOption> getCities() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Ajmer'));
                    options.add(new SelectOption('id','Bhopal'));
                    return options;
                    }
        
        public List<SelectOption> getVillages() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Kishangarh'));
                    options.add(new SelectOption('id','Nimach'));
                    return options;
                    }               
}

I have created a custom button named addStudent  on class detail page. When i click on this button a pop window open.In this pop window there is a text box to add student name and a save button to save student of that class.I want that when i click on save button the exitsting window with text box and save button should be closed as soon as i click on that button and a student detail page open in place of class detail page.

How can we apply multiple searching using one searching button?

For example we have three text boxes and one searching button.Using that button how can we search using all three criteria.

I have a column that is a multi-select picklist. I would like to translate the semi-colons returned from SOQL to spaces before I display this value. How would I replace all the ';' with spaces?

Here is the part of my page that displays this column
        <aura:iteration items="{!v.territories}" var="t">
            <tr>
                <td>{!t.States__c}</td>
            </tr>
        </aura:iteration>

This currently looks like "AK;AL;AR;AZ;CA;CT;CT;DE;FL;GA;HI;IA;ID;IL;IN;KY"  which does not wrap well.
Hi All , 

I have requirement where i need to create Lightening component which should generate Gantt chart on specified object. Gantt should populate on the detail page of the specified object.  Downthe line that component provides the flexitbilty to be used in salesforce 1 or inside visualforce pages. 

As i new to the Lightenign framework. Can one someone suggest me the functional flow (design) to create a gantt chart component. Any help would be greatly appreciated. Thank you.
Hi.

We have customized the Oppurtunity page and it is fine in the classic version.  Now, the lightning has enabled and we had a lot of issues.  One particular issue that still not fixed is this.

While saving an opportunity, in the classic mode, it redirects to the classif view and that is fine.  No issues in this
But, when we switch to Lightning and then save an opportunty it redirects to the classic view.

The URLS in both these are different.  While we are fine about controlling whatever is there for the classic mode, it is not clear about how to control for the lightning mode.

Here is the classic url
https://port--sendilc.cs11.visual.force.com
Here is the lightning url
https://port--sendilc.lightning.force.com/one/one.app?source=aloha#/

However, the code is in the same place. 

We are trying to see how to get this working.. 

Could someone help pls...

Thanks
Sajiv, Chennai






 
Hi All

How to put Space between Amount,Day ,Rate and Brokerage in table..


User-added image
 
<tr>
                   <td>
                       <table border="0" cellspacing="0" width="100%">
                            <tr>
                                 <td valign="middle" align="left" width="20%" style="right: 546.117px; top: 434.567px; font-size: 20px; font-family: serif; transform: scaleX(1.00015);" >
                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u> Name of the Lender</u>
                                 </td>
                                 <td valign="left" align="left" width="90%" style="left: 546.117px; top: 434.567px; font-size: 20px; font-family: serif; transform: scaleX(1.00015);">
                                   <u> Amount</u>
                                 </td>
                                
                                 <td  width="80%"  style="left: 546.117px; top: 434.567px; font-size: 20px; font-family: serif; transform: scaleX(1.00015);">
                                    <u>Days</u>
                                    
                                 </td> 
                                 <td valign="left" align="left" width="10%" style="left: 546.117px; top: 434.567px; font-size: 20px; font-family: serif; transform: scaleX(1.00015);">
                                   <u> Rate</u>
                                 </td>
                                 <td valign="right" align="right" width="10%" style="left: 546.117px; top: 434.567px; font-size: 20px; font-family: serif; transform: scaleX(1.00015);">
                                   <u>Brokerage(Rs.)</u>
                                 </td>    
                            </tr>

 
Regarding the Challenge "Create a Lightning Component to display Case information", under module "Using Apex in Components ",
'DisplayCaseController' Apex Class is written:
User-added image
But, the DisplayCase Component is not being saved, showing error that no such controller is found.
User-added image
So, can't complete the Challenge.
Can anyone help? Thanks in advance

Warm Regards,
Sourav

  How to select city in a picklist by selecting a state in another picklist?

 

    I have made an object called "State". There are three custom fields :

                                                                     1. State

                                                                     2. City

                                                                     3. Village

                                                                      in this object.

I have made  picklists for state, city and village . I want that whenever i select a state, city associated with this state got select. And also when i want that  whenever i select a city, Village associated with this city got select.If you have any solution please tell me.Thanks .

I have written code for that which is as follow:-

                                             For page

<apex:page controller="sampleCon">
<apex:form >
<apex:actionFunction name="Citysearch" action="{!getCities}" reRender="result" status="status1"/>
<apex:actionFunction name="Villagesearch" action="{!getVillages}" reRender="result" status="status2"/>

<apex:selectList value="{!State}" size="1" onclick="searchCity()" >
<apex:selectOptions value="{!items}" />
<apex:actionStatus startText="Searching..." stopText="Search Result" id="status1" >
</apex:actionstatus>
</apex:selectList>

<apex:selectList value="{!City}" size="1" onclick="searchVillage()">
<apex:selectOptions value="{!Cities}"/>
<apex:actionStatus starttext="searching..." stoptext="Search Complete" id="status2" >
</apex:actionStatus>
</apex:selectList>

<apex:selectList value="{!Village}" size="1">
<apex:selectOptions value="{!Villages}"/>
</apex:selectList>

</apex:form>
<script>
function searchCity(){
// alert('hiiiiiiiiiii');
getCities();
}
function searchVillage()
{
// alert('hello');
getVillages();
}
</script>
</apex:page>
For controller
public class sampleCon {
        String id;
        public StateCity__c State{get;set;}
        public StateCity__c City{get;set;}
        public StateCity__c Village{get;set;}
        
        public List<SelectOption> getItems() {
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Rajasthan'));
                    options.add(new SelectOption('id','MP'));
                    return options;
                    }
        
        public List<SelectOption> getCities() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Ajmer'));
                    options.add(new SelectOption('id','Bhopal'));
                    return options;
                    }
        
        public List<SelectOption> getVillages() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Kishangarh'));
                    options.add(new SelectOption('id','Nimach'));
                    return options;
                    }               
}

I have made an object called "State". There are three custom fields :

                                                                     1. State

                                                                     2. City

                                                                     3. Village

                                                                      in this object.

I have made  picklists for state, city and village . I want that whenever i select a state, city associated with this state got select. And also when i want that  whenever i select a city, Village associated with this city got select.If you have any solution please tell me.Thanks .

I have written code for that which is as follow:-

                                             For page

<apex:page controller="sampleCon">
<apex:form >
<apex:actionFunction name="Citysearch" action="{!getCities}" reRender="result" status="status1"/>
<apex:actionFunction name="Villagesearch" action="{!getVillages}" reRender="result" status="status2"/>

<apex:selectList value="{!State}" size="1" onclick="searchCity()" >
<apex:selectOptions value="{!items}" />
<apex:actionStatus startText="Searching..." stopText="Search Result" id="status1" >
</apex:actionstatus>
</apex:selectList>

<apex:selectList value="{!City}" size="1" onclick="searchVillage()">
<apex:selectOptions value="{!Cities}"/>
<apex:actionStatus starttext="searching..." stoptext="Search Complete" id="status2" >
</apex:actionStatus>
</apex:selectList>

<apex:selectList value="{!Village}" size="1">
<apex:selectOptions value="{!Villages}"/>
</apex:selectList>

</apex:form>
<script>
function searchCity(){
// alert('hiiiiiiiiiii');
getCities();
}
function searchVillage()
{
// alert('hello');
getVillages();
}
</script>
</apex:page>
For controller
public class sampleCon {
        String id;
        public StateCity__c State{get;set;}
        public StateCity__c City{get;set;}
        public StateCity__c Village{get;set;}
        
        public List<SelectOption> getItems() {
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Rajasthan'));
                    options.add(new SelectOption('id','MP'));
                    return options;
                    }
        
        public List<SelectOption> getCities() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Ajmer'));
                    options.add(new SelectOption('id','Bhopal'));
                    return options;
                    }
        
        public List<SelectOption> getVillages() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Kishangarh'));
                    options.add(new SelectOption('id','Nimach'));
                    return options;
                    }               
}

How can we apply multiple searching using one searching button?

For example we have three text boxes and one searching button.Using that button how can we search using all three criteria.