• Arun Adepu
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies
Hi friends,

I have requirement like this...
I have two custom objects are a and b these are parent and child relation.
And I have two standard objects are Account and Contact.
 I need to get how many records with same name in b and Contact from their parents...
so, how can i do this plz give me advices for my requirement....it is very urgent..

Thanks
Arun
Hi Friends,

I have requirement like this..
i have fields in user are firstname, lastname, title and contact fields are firstname, lastname and title.
when ever i update field values in user that also update contact fields if contacts are partner contacts..
please resolve immediately...
Hi all,

Inbound email:
if you get any Inbound email from external user to salesforce.
if that email is existing record in contact then go and create case for that
if that email is not exist then automatically send email like this
your email id is not registered please register with us.

please solve immediately and how to write trigger on above requirement

thanks 
arun
requirement:
first take two custom objects like customer and payment.
you should create one record in customer object with sam name.
you have to create look up relationship of customer object in payment object
after that you need to create 10 records in payment but with different users
one user has 6 records and another user has 4 records.
these two users connect with only customer who's name is sam.

condition:
if:
when ever sam's record is deactivate in customer object automatically
who has more records in payment that person should be owner of that particular sam's record

using only map <id, list<user>> 

please resolve this immediately

thanks
arun
hi every one,

       i have requirement like this two objects are custom objects one is customer another one is payment. i created look up relationship in payment object i.e customer. then i created 10 records for payment with two different users. X user has 6 records in payment with xxx customer and Y user has 4 records with xxx customer. whenever i deactivate the owner of customer record then in payment who has more records of user should be the owner of that customer record... i am phasing this issue since last one week please resolve this...
please give me the track to find out this......
Hi Friends,

I have requirement like this..
i have fields in user are firstname, lastname, title and contact fields are firstname, lastname and title.
when ever i update field values in user that also update contact fields if contacts are partner contacts..
please resolve immediately...
Hi all, 

I have a problem with this challenge :

Create a Queueable Apex class that inserts the same Contact for each Account for a specific state. Write unit tests that achieve 100% code coverage for the class.
Create an Apex class called 'AddPrimaryContact' that implements the Queueable interface.
Create a constructor for the class that accepts as its first argument a Contact sObject and a second argument as a string for the State abbreviation.
The execute method must query for a maximum of 200 Accounts with the BillingState specified by the State abbreviation passed into the constructor and insert the Contact sObject record associated to each Account. Look at the sObject clone() method.
Create an Apex test class called 'AddPrimaryContactTest'.
In the test class, insert 50 Account records for BillingState "NY" and 50 Account records for BillingState "CA". Create an instance of the AddPrimaryContact class, enqueue the job and assert that a Contact record was inserted for each of the 50 Accounts with the BillingState of "CA".
The unit tests must cover all lines of code included in the AddPrimaryContact class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.


I haven't 100% for my test class. 
 
@isTest
 public class AddPrimaryContactTest {
   
   
     @isTest static void TestList(){
         List<Account> Teste = new List <Account>();
         for(Integer i=0;i<50;i++){
             
             Teste.add(new Account(BillingState = 'CA', name = 'Test'+i));
         }
             for(Integer j=0;j<50;j++){
             
             Teste.add(new Account(BillingState = 'NY', name = 'Test'+j));
         
         }
         insert Teste;
         Contact co = new Contact();
          String state = 'CA';
     AddPrimaryContact apc = new AddPrimaryContact(co, state);
	Test.startTest();
	System.enqueueJob(apc);
     Test.stopTest();
         for (Account t:Teste){
             if( t.BillingState == 'CA'){
               	  
             	System.assertEquals(1, t.Number_of_contacts__c);
            
             
         }
         }      
}
 }
 
public class AddPrimaryContact implements Queueable{
    private Contact c;
    private String state;
    public  AddPrimaryContact(Contact c, String state){
        this.c = c;
        this.state = state;
        
    }
     public void execute(QueueableContext context) {
        List<Account> ListAccount = [SELECT ID, Name FROM ACCOUNT WHERE BillingState = :state LIMIT 200];
         for (Account l:ListAccount){
             for (Contact co:l.Contacts){
                 
                 c = co.clone(false,false,false,false);
                 insert c;
             }
                 
                 
             }
             
         }

}


Anyone can help me please?
Thanks!