• Vinay Chaturvedi_SFDC
  • NEWBIE
  • 5 Points
  • Member since 2014
  • Salesforce Developer
  • Fujitsu


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 5
    Questions
  • 5
    Replies
Hi ,
I have a query:


Select Id, Name, test__c, Unique_Key__c From Customer__c Where test__c like \'%'+obj.Unique_Key__c+'%\'

now background is for eg:test__c is 0001 and Unique key is 0001-0002-0003
I know what i am implementing is wrong.Can anyone please suggest me if there is any poosibility by doing i can achieve the requirement.
Basic requirement is to compare a part of string of Unique__c with test__c
Hi,
Is there anyway i can upload files in chatter answers???
I have added Q&A tab in Community.
I know that we can upload images but not sure if can upload files similar to chatter .
How to use Radio buttons for datalist
I have used the example for radio button.
On clcking submit button,user should be able to view the selected answer,but its happening only when i am selecting radio buttons in all the questions.
It want it to happen for individual  question.
Here is my code:
<apex:page controller="sampleCon" sidebar="false" standardStylesheets="false">
  
   <style>
   #vinay
   {
    background-color:#F0F0F0 ;
    border:3px solid black;
   }
   #vinay ul li
   {
    background-color:#F0F0F0 ;
    font:15px arial,sans-serif;
   
   }
   #vinay ul li span
   {
   font-size:15px;
   font-weight:bold !important;
   font-family:sans-serif;
   }
  #vinay ul li span p
   {
   font-weight:normal !important;
   font-size:15px;
   font-family:sans-serif;
   }
    </style>
     <apex:form >
    
     <div id ="vinay" >
       <apex:dataList id="Datalist1" value="{!Question}" var="Dlist" type="A" title="Quiz" rows="2">
          <apex:outputField label="Question" value="{!Dlist.Question_Detail__c}"/><br/>
         <apex:selectRadio id="SelectRadio1" value="{!answer}" layout="pageDirection" label="test" required="true" >
         <!-- <apex:actionSupport event="onchange" action="{!MethodOne}" reRender="test"/>  -->
         <apex:selectoption id="A" itemlabel="{!Dlist.Option_1__c}" itemvalue="{!Dlist.Option_1__c}" />
         <br/>
         <apex:selectoption id="B" itemlabel="{!Dlist.Option_2__c}" itemvalue="{!Dlist.Option_2__c}" />
         </apex:selectRadio>
         <!--  <apex:outputText id="test" value="{!test}"></apex:outputText> -->
       <apex:commandButton value="Submit" action="{!test}" rerender="out" status="status" />        
        
         <apex:outputPanel id="out">
          <apex:actionstatus id="status" startText="Please wait...">
             <apex:facet name="stop">
               <apex:outputPanel >
                  <p>You have selected:
                 <apex:outputText value="{!answer}"/></p>
              </apex:outputPanel>
            </apex:facet>
          </apex:actionstatus>
     </apex:outputPanel>
     
          </apex:dataList>        
     </div>         
     </apex:form>
     
</apex:page>

Controller:

/*** Controller ***/public class sampleCon {
   public String answer = 'None';
 
  //mAP TESTING
  /* public Map<String,String> selected{
    get
    {
           
            return new Map<String, String> {
           
        };
    }
    set;
} */

//List Testing
/*public List<String> listselected {
    get {
        return new List<String>;
      }
    set;
}*/

     public String getAnswer() {      
         return answer;
    }
                   
    public void setAnswer(String answer)
    {this.answer= answer;}
        
    public PageReference test() {
       
        return null;
    }
    public List<Question__c>listQuestion{get;set;}
    public List<Question__c>getQuestion (){
    
     List<Question__c>listQuestion=[Select id,Name,question_detail__c,Option_1__c,Option_2__c from question__c];
    
        return listQuestion;
     }          
                      
  
    //public String answer {get; set;}
   
}


Hi,
Community self registration page is not working.When an external user wants to self register.The error appearing is "Your request can't be processed.site administrator has been alerted".
Normally,external users when created a contact is also created which  should be connected with an account.
When  a user tries to sign up,user isnt created but contact is created for that account.
Also,Site Administrator is recieving the below mail:
"ABC Community has reached the available portal license limit. Registration from ABC Community are not able to create portal users. "
Please help me resolve this issue.
This my apexclass:
------------------------------
Public class CreateMultiplePatients{
ID DoctorID;

public Doctor__c docObj{get;set;}
public List<Patient__c> multiplePatients{get;set;}

public CreateMultiplePatients(ApexPages.StandardController varName){
multiplePatients = New List<Patient__c>();
DoctorID = apexpages.currentpage().getparameters().get('id');
 docObj = [SELECT id,name,Address__c,daysworking__c,Salary__c,Joining_Year__c,specialization__c FROM Doctor__c where id=:DoctorID];
       
        Patient__c newpatient = New Patient__c();
        multiplePatients.add(newpatient);


}
public void addRow(){
         Patient__c newpatient = New Patient__c();
         multiplePatients.add(newpatient);
    }
 public void saveMultiplepatients(){
        for(integer i=0;i<multiplePatients.size();i++){
           / multiplePatients[i].Doctor__c =DoctorID;
        }
        insert multiplePatients;
        
        
}
}
Hello - I am receiving 0% coverage on the below trigger which seems simple enough.  Can anyone please advise here?  My unit test is below.

trigger CannotDeleteAccount on Account (before delete){

    for  (Account a: trigger.old){

        if (a.Current_User_Profile__c != 'System Administrator' && a.Client_Code__c != null){
    
            a.adderror('Account is synced and cannot be deleted or merged.');
           
        } 
    }
}

==========================================================================
Unit Test:

@isTest
public class TestCannotDeleteAccount {
    
    public void myTestMethod(){
       
       Profile p = [SELECT Id FROM Profile WHERE Name='Standard User'];
       
       User u = new User(Alias = 'standt', Email='standarduser@testorg.com',
       EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',
       LocaleSidKey='en_US', ProfileId = p.Id,
       TimeZoneSidKey='America/Los_Angeles', UserName='standarduser@testorg.com');
       insert u;
       
       system.runAs(u){

       SIC_Code__c sic = new SIC_Code__c(Name = 'Education',SIC_Code__c = '12345');
        
       insert sic;
        
       Account a = new Account(Name = 'Test', Legal_Entity__c = 'Corporation', Description = 'Test', Phone = '2125551234',
       Primary_City__c ='NY',Primary_Country__c = 'United States', Primary_State_Province__c = 'NY', Primary_Street__c = '32 Old Slip',          Primary_Zip_Postal_Code__c = '10001',
       Rating = 'Cold',Industry = 'Education', SIC_Code_Nmae__c = sic.id, Client_Code__c = '12345');
        
       insert a;
              
       try
        {
            Delete a;
        }
                catch(Exception e) {
                    {
                        system.assertEquals('Account is synced to billing system and cannot be deleted or merged.', e.getMessage());
                    }
                }
       }
        
    }   
}
Hello,

I am currently trying to change the "Send" button that is displayed in the Live Agent Chat Window. I guess I'm just being dumb somehow, but I cannot find the component where I can change this. Can you help me out with a detailed description of where to find that component so I can exchange the existing send button with a picture?
  • April 04, 2014
  • Like
  • 0

Hi,

  the following is my example.......problem is " when i click radio button i want to store radio buton value which i selected and as wel as associated question also".....and i got how to store radio button value when i click,but i did n't get the associated question........ please help me on this.

 

Question : Who was the developer of 'C' language

Bjarne Stroustrup
James Gosling

Dennis Ritchie

I can't seem to get the pagination to work. I've looked over various examples and my code looks good to me. I'm sure I'm missing something very obvious (at least to someone else) - please help.

 

Here's my controller class:

 

 

public with sharing class zipMap {

public String zips { get; set; }

public PageReference find() {

return null;

}

public ApexPages.StandardSetController accts {

get {

//List<String> zList = new List<String>();

//zList = zips.split(',');

accts = new ApexPages.StandardSetController(

Database.getQueryLocator(

[SELECT Id, Name, BillingStreet, BillingCity, BillingState, BillingPostalCode FROM Account WHERE BillingPostalCode = '10022' ORDER BY BillingPostalCode, Name]

)

);

accts.setPageSize(2);

return accts;

}

set;

}

public List<Account> getAccounts() {

return (List<Account>) accts.getRecords();

}

public Integer pages {

get {

pages = accts.getResultSize()/accts.getPageSize();

return pages;

}

set;

}

public Boolean hasNext {

get {

return accts.getHasNext();

}

set;

}

public Boolean hasPrevious {

get {

return accts.getHasPrevious();

}

set;

}

public Integer pageNumber {

get {

return accts.getPageNumber();

}

set;

}

public void first() {

accts.first();

}

public void last() {

accts.last();

}

public void previous() {

accts.previous();

}

public void next() {

accts.next();

}

public void cancel() {

accts.cancel();

}
}

 

 

VF:

 

 

<apex:page controller="zipMap" showHeader="false" sidebar="false" tabStyle="Account">
<apex:form >

<apex:pageBlock title="Search by Zip">
<apex:inputText value="{!zips}" />
<apex:commandButton value="Search" action="{!find}" />
</apex:pageBlock>

<apex:pageBlock title="Nearby Company/Branch">
<apex:pageBlockTable value="{!accounts}" var="acct" id="accountTable">
<apex:column headerValue="Company/Branch">
<apex:outputLink value="/{!acct.Id}" target="_top">{!acct.Name}</apex:outputLink>
</apex:column>
<apex:column headerValue="Address" colspan="2">
<apex:outputText >{!acct.BillingStreet}, {!acct.BillingCity}, {!acct.BillingState}, {!acct.BillingPostalCode}</apex:outputText>
</apex:column>
<apex:column >
<apex:outputLink value="http://maps.google.com/maps?f=d&source=s_d&saddr=&daddr={!acct.BillingStreet},{!acct.BillingCity},{!acct.BillingState},{!acct.BillingPostalCode}" target="_blank">Get Directions</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>

<apex:panelGrid columns="4">
<apex:commandLink action="{!first}" rendered="{!pages > 1}">First</apex:commandLink>
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandLink>
<apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandLink>
<apex:commandLink action="{!last}" rendered="{!pages > 1}">Last</apex:commandLink>
</apex:panelGrid>

</apex:form>
</apex:page>

 

 

Thanks!

 

Adriel

  • August 17, 2010
  • Like
  • 0

Hi,

  the following is my example.......problem is " when i click radio button i want to store radio buton value which i selected and as wel as associated question also".....and i got how to store radio button value when i click,but i did n't get the associated question........ please help me on this.

 

Question : Who was the developer of 'C' language

Bjarne Stroustrup
James Gosling

Dennis Ritchie