• Devendra Natani
  • NEWBIE
  • 265 Points
  • Member since 2010
  • Salesforce Practice Head
  • Appcino Technologies Pvt Ltd

  • Chatter
    Feed
  • 10
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 73
    Replies
trigger accountnameuppercase on account (before insert,before Update) {
    List<account> acclist = trigger.new;
    nameupper.makeuppercase(acclist);
}

apex class:::

public class accnameuppercase{
    public static void makeuppercase(List<account> acclist){
        for(account a : acclist){
       String rep_name =a.name;
List<String> elems = rep_name.split('');
rep_name = '';
for (String x : elems)
{
    rep_name += x.substring(0,1).toUpperCase()+x.substring(1,x.length() ) + ' ';
}  

   a.name=rep_name;
   
        }
        }
        }
I have installed apptus from Appexchange .. As per my requirment i need to change controller .. but controller code not visiable.. plz help me on this if any one ave idea.

Hello,

 

We have a search page where we are displaying account and contact records. We do have search box and some filter criterias on this page as well. When I click on search button ( using actionFunction to call the controller method), It gives me the following error. 

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

Note - This org has been updated to summer 2013 yesterday. The search functionality was working fine till yesterday. 

Please let me know if any one else is having the same issue as well or its related to summer 13. 

 

Thanks,

So I am kind of new to field sets. I have put them in my visualforce page but I have a question. 

 

I have some Long Text Area fields in my field set and when I render them on the page inside of <apex:inputField> tag they are really small. I was wondering is there a way to resize these fields? I ask because I have multiple fields with different field types in the field set and I don't think changing the style of the <apex:inputField> tag will help me much.

Hi,

 

Currently i am displaying help text on VF Page instead of field label names because field names are having many characters in it.

I need to display poup help text on dat VF page where i am displaying  help text instead field label.

 

  • Help text pop-up are having more than 255 characters in it.
  • Every field is having different description in it.

 

  • MY Question:Is there anyway i can display  pop up help text on VF Page?

 

  • Thanks in Advance.Plz help me out 

I am having Account object. the field name is  Account_secondary_result__c,help text=secondary.Currently i am displaying the help text "seconday" on VF page.

 

when i moves cursor on to the field name i.e help text on VF page ......I need to display the pop up help on the particular field.I am having like mote than 5 fields with different pop up help description exceeding 255 characters.

 

 

Urgent: IS there anyway i can  display  pop up help on   VF Pagefield i.e. help text

Hi , am writing an apex trigger in which I need to validate the account name if already exist before insertion... so this trigger event will be "before insert" on "Account" object... my question is there is a way from the trigger to stop the insertion process and rase an error or warning to the user that this account name already exist?

 

can some one please tell me what exactly is bulkification of trigger

Hi All,

 

I need to use controller class variable in javascript onClick event. For this I used below code.

I am getting NULL value instead of  "samplevariable" which hardcoded in class variable while click Javascript function and m

VFP:

 

<apex:page id="pageForm" controller="formController">
    <apex:form id="form">
         <apex:inputHidden value="{!myObject.textdata}" id="hidBusiness"/>
        <apex:commandButton id="btnSave" onclick="javascript&colon;if(!confirmation()) return false;" value="save"/>
    <script>
       function confirmation()
        {
          var hidBusiness= document.getElementById("{!$Component.hidBusiness}");
          alert('Hi'+hidBusiness);
        }
    </script>
    </apex:form>
</apex:page>

 

Controller class:

public class formController {

  public class MyObject {
     public String textdata = 'samplevariable';

    public String getTextData() { return textdata; }
    public void setTextData(String data) { textdata = data; }

  }

hey Ragjesh your code helped me a lot but am getting null value in my controller can you suggest me the exact solution of this problem

 

 

here is my code:

Apex Code:

<apex:actionFunction name="sendTimeStamp" action="{!sendTimeStamp}">
    <apex:param name="x" value="x" assignTo="{!timeStampValue}" />
    </apex:actionFunction>

javascript code:

timeStamp = Number(new Date());
          sendTimeStamp(timeStamp);

controller code:


public string sendTimeStamp() 
    {
        return timeStampValue;
    }
    public string timeStampValue{
    get
    {
        timeStampValue = timeStamp;
        return timeStampValue;
    }
    set;}

 please Help me i am newbie in salesforce

 

i dont know where i am making mistakes?

I have an issue where the validation rule error message on a custom object doesn't appear at the top or field level but instead on a separate page with a DML exception error.  I know I could use a catch statment but not sure where to put it.

 

 

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The Alternative Delivery date must be after the Delivery Date. Please adjust the Alternative Delivery date.: [] 

Class.NewRenterOpportunity.Save: line 12, column 1

 

Class:

public class NewRenterOpportunity {

    public Opportunity opp{get;set;}
    public Renter__c rentr{get;set;}
    public NewRenterOpportunity(ApexPages.StandardController controller)
    {
        rentr = (Renter__c)controller.getRecord();
        Id id = ApexPages.currentPage().getParameters().get('id');
     
    }
    public PageReference Save(){
     insert rentr;
        opp = new Opportunity();
        opp.Name =  rentr.Renter_s_First_Name__c + ' ' + rentr.Name;
        opp.Renters_Email__c = rentr.Renters_Email__c;
        opp.Renters_Phone__c = rentr.Renters_Phone__c;
        opp.StageName = 'Proposal/Price Quote';
        opp.CloseDate = System.today()+2;
        opp.Classification__c = rentr.Classification__c;
        opp.Lease_Term__c = rentr.Lease_Terms__c;
        opp.Residential_Opportunity_Source__c = rentr.Source__c;
        opp.Renter_s_Price_Range__c = rentr.Budget__c;
        opp.Need_Office_Furniture__c = rentr.Need_Office_Furniture__c;
        opp.Need_Housewares__c = rentr.Need_Housewares__c;
        opp.Need_Finishing_Touches__c = rentr.Need_Finishing_Touches__c;
        opp.Need_Electronics_Appliances__c = rentr.Need_Electronics_Appliances__c;
        opp.Description_of_Items__c = rentr.Details_of_what_they_need__c;
        opp.Other_Potential_Renters__c = rentr.Other_that_need_to_rent__c;
        opp.Pertainent_Notes__c = rentr.Why_the_need_to_rent_furniture__c; 
        opp.Potential_Renters__c = rentr.Other_Potential_Renters__c;
        opp.Delivery_Date__c = rentr.Delivery_Date__c;
        opp.Alternate_Delivery_Date__c = rentr.Alternate_Delivery_Date__c;
        opp.Delivery_Street__c = rentr.Delivery_Street__c;
        opp.Delivery_City__c = rentr.Delivery_City__c;
        opp.Delivery_State__c = rentr.Delivery_State__c;
        opp.Delivery_Zip__c = rentr.Delivery_Zip__c;
        opp.Showroom__c = rentr.Showroom__c;
 
        String AccountId;
        opp.Corporation__c = rentr.Company__c; 
        
  
             
        insert opp;
        
        PageReference ref = new PageReference('/'+opp.id);
        return ref;
    }
    public PageReference NewRenters(){
        return null;
    }
    public PageReference Cancel(){
        return null;
    }
  
}

 

 

Hii Right now I am writing test class, I want to know exact use of unit testing ?

Since as I know, It is used to check all syntax & DML operation of the application to avoid bugs or exception.

But I have one case like right now,  In account, there is two type of account named Business account & person account.

Every time we prefer Person Account & I already disable Business account while creating new account so it creates Person account by deafult.

But while writing test class I am writing like this...

acc = new Account(Firstname='manoj', Lastname='gahlot', RecordTypeId='PersonAccountRecordTypeID');

 

So please tell me am I writing correct test for the type Person account ?

hi lets say we have trigger that is triggered when object__c is update. then what does for (Object__c c: Trigger.New) mean. Is it a for each loop that goes through every record that has just been updated for the object__c

I want the test class code. Can anyone suggest me with the test class code for the apex code.

 

 

public with sharing class TextMessage {

List<text__c> appTextMessage = [select text_message__c FROM text__c ];
Map<ID, Contact> contactMap = new Map<ID, Contact>([select id, firstname from contact]);
List<String> displayMessage = new List<String>();

public List<String> messageTemplate()
{  
  
  for (text__c textMessage : appTextMessage)
     {
    String text = textMessage.text_message__c;
  if(text !=null  ){
    Set<ID> keyId = contactMap.keySet();
    for(ID c :keyId){
      displayMessage.add(contactMap.get(c).firstname + ' ' + text + '\n');
      System.debug(displayMessage);
    }
  }
      }
    
  return displayMessage;
}

}

 Thanks in advance.

Hi champs..

 

I am very new to salesforce and apex programming.

 

I am trying to stop an email notification (when case status is set to completed) sent from an apex trigger. I tried setting the EmailHeader.triggerUserEmail = false but it does not seem to work.

 

is there any other way i can stop this notification.

 

Thanks in advance.........


Regards,

Din

 

Hi,

 

I have created one object called Job which has lookup relationship with Schedule Template object.

I have another object Schedule Template Item which has master-detail relationship with Schedule Template object.


Job (Master) and Schedule Template (Child) : Lookup Relationship

Schedule Template (Master) and  Schedule Template Item (Child) : Master-Detail Relationship

I want to retrive Schedule Template Items.

How to do it?

Using visualforce,apex code how can i display related Schedule Template Items of particular Schedule Template?

 

Cheers,

Devendra S