• alok7049
  • NEWBIE
  • -2 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

How to make lead custom fields available to Account via lead mapping.

 

Guys help me out.

I have written test case for this trigger.but can anyone tell me where is wrong in this...

 

trigger copystreetaddress on JunctionObject__c (be​fore insert)
{
      
    if(trigger.isInsert)
    {
        Set<Id> accountId = new Set<Id>();
        Set<Id> contactId = new Set<Id>();
        for(JunctionObject__c tempJ : Trigger.new)
        {
            accountId.add(tempJ.Account__c);
            contactId.add(tempJ.Contact__c);
        }
        
        List<Account> AccountList = [Select id,Nam​e,BillingStreet from Account where id in: accountI​d];
        
        List<Contact> ContactList = [Select id,Nam​e,OtherStreet from Contact where id in: contactId]​;
        
        for(JunctionObject__c tempJ : Trigger.new)
        {
            for(Account tempAcc : AccountList)
            {
                if(tempJ.Account__c == tempAcc.Id)
                {
                    for(Contact tempCon : ContactL​ist)
                    {
                        if(tempJ.Contact__c == tem​pCon.Id)
                        {
                            tempCon.OtherStreet = ​tempAcc.BillingStreet;
                        }                   
                    
                    }
                
                }
            
            }   
            
        }       
            update ContactList;
    }
       
}

 

@isTest
private class copyStreetAddress {   
static testMethod void testStreetAddress() {

Contact con = new Contact(Lastname = 'test contact1',MAILINGSTREET = 'street',otherStreet='Hi', MAILINGCITY = 'city', MAILINGSTATE = 'state', MAILINGPOSTALCODE = 'code', MAILINGCOUNTRY = 'country');  
insert con;
Account acc=new Account(Name='roger federer1' ,billingStreet='hello');
insert acc;
JunctionObject__c Jo=new JunctionObject__c(Name='test12',Account__c=acc.id,contact__c=con.id);
insert Jo;

System.assertEquals(con.otherStreet,acc.billingStreet);

}
}


        

how to Make the Visualforce page accessible via a Web Tab.

web tab content should change a/c to the visualforce content....changing with records(No hardcoding).

 

do help me.

 

Thanks.:)

controller method

.......................................

public class VfController{
                private final Contact con;
                
        public VfController(){
        con=[select id,name,Account.name,Account.id,Account.billingstreet from contact where id=:
           Apexpages.currentpage().getParameters().get('id')];
}
     public contact getCon(){
     return con;
     }
     public pageReference save(){
      update con;
      return null;
      }
      }

 

 

prob is :Add a trigger that when a join object is inserted, the trigger will copy the billing street address from the related Account to the other streets address on the related Contact.

 

can any one please help me out in doing this.

how to Make the Visualforce page accessible via a Web Tab.

web tab content should change a/c to the visualforce content....changing with records(No hardcoding).

 

do help me.

 

Thanks.:)

prob is :Add a trigger that when a join object is inserted, the trigger will copy the billing street address from the related Account to the other streets address on the related Contact.

 

can any one please help me out in doing this.

Hi All,

 

I want to do certification on salesforce.If any one know which material is usefu Plz guide me.

If any dumps are there plz send me those links.Plz guide me in properway.

 

Thanks in advance,

Manu

  • June 22, 2010
  • Like
  • 0