• PlatFormCloud
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 10
    Replies
I was reading the APEX guide provided by Salesforce. Can someone please elaborate the rationale (System.assert) of the below code:
 

String s;
System.assert('a' == 'A');
System.assert(s < 'b');
System.assert(!(s > 'b'));
Thanks!
 
Hi Experts,
What is the difference between Clone () and DeepClone() in Apex? When should we use what? Can someone explain with an example?

Thanks!

Hi Experts,
I have a functionality, where I donot want users to provide duplicate Email associated with Account. The below triggers works perfectly. If there ate 100K Account records are present in the SalesForce System, then will the below triggers work?
 
/* Preventing users creation of duplicate in Salesforce*/
trigger PreventDuplicateNameAccount on Account (before insert, before update) {


       //Preparing Account names in Set from trigger.new

        Set<String> nameSet = new Set<String>();

        for(Account acc : trigger.new){

            nameSet.add(acc.Email__c);        

        }

        // getting the list of accounts in database  with the account name we entered ( trigger.new)

        List<Account> accList = new List<Account>(
            [select id,name, Email__c from Account where Email__c in: nameSet]);

        for(Account a : trigger.new){

            if(accList.size() > 0 )
                a.addError('Accounts Email already exists in your Organization with Email '+a.Email__c);

        }
}

 
Hi saleForce Experts,
I have a trigger on Contact. I hahe functionality to update the number of contacts in Account. I have a field in Account as "No_of_Associated_Contacts__c". Below is the trigger. 
Please help me Where I am doing wrong?

trigger NumberOfContacts on Contact (after insert, after undelete) {
  Set<Id> accountIds = new Set<Id>();
    for(Contact c:trigger.new){
         accountIds.add(c.Id);
        }
    List<Account> accLst = [SELECT ID, No_of_Associated_Contacts__c FROM Account where Id IN:accountIds];
    List<Contact> con = [SELECT Id FROM Contact WHERE Accountid IN:accountIds];
    
  for(Account a: accLst){
      a.No_of_Associated_Contacts__c = con.size();
      System.debug('Number Of Associated Contacts' + a.No_of_Associated_Contacts__c);
      System.debug('Number Contact Size' + con.size());

      
  }
   update accLst;
}
Hi experts,
Very basic question and find difficult to understand. And please let me know, when to use what?

What is the difference between these 2 coding structures:
1.  public String name {
         get { return name;}
        set { name = value;}

2. public String name{get;set;}
I want to show the Start Date and End Date in user's Local time Zone. For this I have created a Visual Force Page and through getter and setter method, when I am showing IN VF Page,I am getting the time in GMT. What is the way for the the logged-in user to show the local time in Visual force Page?
 
Hi,

Please any one can explain me about apex:repeat component in salesforce? where we can use?

regards,
Sain