• Sasidhar Reddy B
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
Hi Guys,

I need to send Email alert for today created contacts list . 
Contact records are inserted through automation. Manager expecting in single mail to fetch list of contact records creted by today .
Can you please guide me , how to i achive this ? 


Ex:Email template 

HI Manger,
Today Contact records listed below .

ID   name         mail                        phone    createddate
001  sasi         sasi@gmail.com       123         today
002   sachin     sacina@gmai.com    234         today
003  sehwag     sehwag@gmail.com  345        today

Thanks& Regards,
Sasidhar



















  
 
I have 2 objects contact(Parent) and loyalty__c (child), i have checkbox field (Loyalty_Eligibility__c) and text field(Loyalty_Lifetime_value__c) on both the objects so when this check box is checked and text field entered on any of it's child records then the parent field (Contact_Eligibility__c,Contact_Lifetime_value__c) has to be updated and viceversa.
   
   
Hi Guys,

I coverd 27% code coverage .

Can you please guide me ? How to cover list<Loyalty__c> ListRecods Soql Qureis? 


public class SearchAndEditLoyaltyRecord {
   public String Email{get;set;}
    public String Email1{get;set;}
    public String HomePhone{get;set;}
    public String HomePhone1{get;set;}
    public String mobilePhone{get;set;}
    public String mobilePhone1{get;set;}
    public String name{get;set;}
     public String name1{get;set;}
    public String BusinessPhone{get;set;}
     public String BusinessPhone1{get;set;}
    public String ContactName{get;set;}
    public String ContactName1{get;set;}
    public List<Loyalty__c> Loyalty_records{get;set;}
     public List<Loyalty__c> Loyalty_records1 {get;set;}
    public List<loyaltyWrapper> loyaltywrapperlist{get; set;}
    public List<loyaltyWrapper1> loyaltywrapperlist1{get; set;}
    Public list<Loyalty__c> SelectedLoyalty{get; set;}
    public Boolean Searched{get;set;}
    public Boolean searched2 {get;set;}
     
    
    public SearchAndEditLoyaltyRecord(){
        searched = false;
        searched2 = false;
       
        //SelectedLoyalty=new list<Loyalty__c>();
        String EmailtoSearch = ApexPages.currentPage().getParameters().get('Email');
        String HomePhonetoSearch = ApexPages.currentPage().getParameters().get('HomePhone');
        String mobilePhonetoSearch = ApexPages.currentPage().getParameters().get('mobilePhone');
        String NametoSearch = ApexPages.currentPage().getParameters().get('name');
        String BusinessPhonetoSearch = ApexPages.currentPage().getParameters().get('BusinessPhone');
         String contactNametoSearch = ApexPages.currentPage().getParameters().get('ContactName');
         
          String EmailtoSearch1 = ApexPages.currentPage().getParameters().get('Email1');
        String HomePhonetoSearch1 = ApexPages.currentPage().getParameters().get('HomePhone1');
        String mobilePhonetoSearch1 = ApexPages.currentPage().getParameters().get('mobilePhone1');
        String NametoSearch1 = ApexPages.currentPage().getParameters().get('name1');
        String BusinessPhonetoSearch1 = ApexPages.currentPage().getParameters().get('BusinessPhone1');
         String contactNametoSearch1 = ApexPages.currentPage().getParameters().get('ContactName1');
         
        if(null!=EmailtoSearch||null!=HomePhonetoSearch||
        null!=mobilePhonetoSearch ||null!=NametoSearch||null!=BusinessPhonetoSearch||null!=contactNametoSearch ){
            Email=EmailtoSearch;
            HomePhone=HomePhonetoSearch ;
            mobilePhone=mobilePhonetoSearch ;
            Name=NametoSearch;
            BusinessPhone=BusinessPhonetoSearch;
            ContactName=contactNametoSearch;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone);
            executeSearch();
           // newLoyalty();
        }
        
        if(null!=EmailtoSearch1||null!=HomePhonetoSearch1||
        null!=mobilePhonetoSearch1 ||null!=NametoSearch1||null!=BusinessPhonetoSearch1||null!=contactNametoSearch1 ){
            Email1=EmailtoSearch1;
            HomePhone1=HomePhonetoSearch1 ;
            mobilePhone1=mobilePhonetoSearch1 ;
            Name1=NametoSearch1;
            BusinessPhone1=BusinessPhonetoSearch1;
            ContactName1=contactNametoSearch1;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone1);
            //executeSearch();
         newLoyalty();
        }
    }
    
   
    public PageReference executeSearch(){
    
        if(Loyalty_records==null){
            SelectedLoyalty=new list<Loyalty__c>();
           Loyalty_records=new list<Loyalty__c>();
       }else{
           Loyalty_records.clear();
           SelectedLoyalty.clear();
       }
        String SearchMail = email;
        String SearchmobilePhone=mobilePhone;
        String SearchHomephone =HomePhone;
        String SearchLoyaltyId = Name;
        String SearchBusinessPhone =BusinessPhone;
        String SearchContactName = contactName;
        system.debug('SearchBusinessPhone >>>>>>>>'+SearchBusinessPhone );
        searched = true;
        system.debug('SearchMail >>>>>>>>'+SearchMail);
        system.debug('SearchMail >>>>>>>>'+SearchMail.length() );
        if(SearchMail!=''&&SearchMail.length()!=0||SearchmobilePhone!=''&&SearchmobilePhone.length()!=0 ||
        SearchHomephone !=''&&SearchHomephone .length()!=0 ||
        SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0 || SearchBusinessPhone !=''&&SearchBusinessPhone .length()!=0
        || SearchContactName !=''&&SearchContactName.length()!=0){
          
           if(SearchMail!=''&&SearchMail.length()!=0)
        Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Email  =:SearchMail  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                            if(SearchmobilePhone!=''&&SearchmobilePhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone=:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                                        if(SearchHomephone !=''&&SearchHomephone .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,Contact_Name__r.Homephone,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                          if(SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  name=:SearchLoyaltyId  order by Loyalty_Program_Expiry_Date__c desc nulls last ];
                    
                         }
          if(SearchBusinessPhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c =:SearchBusinessPhone  order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                          if(SearchContactName.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                         
                        /* else {
                          if(SearchMail  == '' || SearchMail == null||SearchmobilePhone== '' || SearchmobilePhone== null||SearchHomephone == '' || SearchHomephone == null){
                system.debug('yes it is entering into this');
       ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Valid Input'));         
                  } 
                        
                  }*/
                        system.debug('Loyalty_records>>>>'+Loyalty_records); 
         
                
                   /*if(SearchMail != ''&& Loyalty_records.size()==0 )  {
                     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'No Loyalty Records With this contact Mail'));     
                  }
                  else {*/
                  if(SearchMail != ''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where Contact_Name__r.Email  LIKE :SearchMail  order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchmobilePhone!= ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone =:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   if(SearchHomephone != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                 if(SearchLoyaltyId != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Name=:SearchLoyaltyId order by Loyalty_Program_Expiry_Date__c desc];
                  }
         if(SearchBusinessPhone!=''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c=:SearchBusinessPhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchContactName!=''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   system.debug('Loyalty_records >>>>>>'+Loyalty_records );
            
        
        return null;
    }
}
Hi All, 

My Requirement is System Administrator going to merge two Different  loyalty records in Loyalty application. 


Contact- Parent Object
Loyalty- Child Object 

Loyalty tier : Formula filed (

statement 1: =>150k,tier1 
statement 2:   >=85k && <150k ,tier2
statement 3:  < $85K,tier 3 )


1.  search  criteria (Email or LoyaltyId or Contact name or Homephone or MobilePhone or etc)
User-added image


.if i search with mail or mobile number or contact name in contact object . then i get child of loyalty records in table. 

Search any  two(or more) Contacts merged manually ,The loyalty object should be merged as well ,using the same logic that is currently in place for merging Contacts.


Merging Fields in Record::

Loyalty Sales Inclusion Value:    saleslifetimevalue+ loyaltysalesinclusionvalue, ex : 0 + $95000= $ 95000 


Saleslifetimevalue=      Saleslifetimevalue (Record 1 )+ Saleslifetimevalue (Record 2 ) = $73000 + $ 95000 = $ 163000


Loyalty Life Time Value:     Saleslifetimevalue+ loyaltysalesinclusionvalue=$ 163000 + 0 = $ 163000




PageBlock Table:
User-added image



Scope:

New Contact: When a customer buys an Audi vehicle for the first time, the system should generate a unique Loyalty ID (LID) for the contact and the retail price of the vehicle shall determine the Loyalty tier for the new contact.

Existing Contact: When an existing customer purchases a 2 nd or subsequent Audi vehicles the retail price of the vehicle will increase the Loyalty life time spend of the contact which may lead to increase in their Loyalty tier based on the total lifetime spend of the contact.

Merging existing Contacts: When two (or more) Contacts are merged manually, the Loyalty Objects

should be merged as well, using the same logic that is currently in place for merging Contacts.



Loyalty Inclusion : Loyalty Inclusion nothing but checkbox validation .
                             if you give checkbox =  true means the record is merged to other record.
                              else checkbox =  false means the record is override based on other record. 

 A Checkbox in Loyalty object traced to the checkbox in Loyalty application identifying 





Scenario1 :  A new customer purchases a vehicle for $73,800 – new contact created:

Contact name:  Sasidhar

Loyalty Id : AC00061 (unique Id)

SaleslifeTime Value : $90,000

Loyalty Sales Inclusion Value: $0


Loyalty Life Time Value :  Sales Lifetime Value + Loyalty Sales Inclusion Value = $90,000+ $0 = $90,000


Loyalty tier determined: Tier 2 (< $85K)


Purchased Vehicles = 1


Purchased Vehicles Inclusion = 0


Loyalty Vehicles: Purchased Vehicles + Purchased Vehicles Inclusion = 1 + 0 = 1


Loyalty Overwrite date = Null



Scenario 2: Existing customer purchased a 2 nd vehicle for $90,000 -existing contact:


Contact name:  Sehwag

Loyalty Id : AC00050 (unique Id)

Sales Lifetime Value: $73,800 + $90,000= $163,800


Loyalty Sales Inclusion Value: $0 + SaleslifeTime Value : $73,800


Loyalty Lifetime Value: Sales Lifetime Value + Loyalty Sales Inclusion Value = $163,800+ $0 = $163,800

4. Loyalty tier determined: Tier 1 (<= $150K)

5. Purchased Vehicles = 2

6. Purchased Vehicles Inclusion = 0

7. Loyalty Vehicles: Purchased Vehicles+  Purchased Vehicles Inclusion = 2 + 0 = 2
8 . Loyalty Overwrite date = Null



Finally Expecting result is : 

User-added image
 
Hi Everyone, 

My Scenario is need to restrict two users not able to see the visual force page in site. 

In my profile have 100 users  i given access profile level but i need to restrict perticuler users have no permission to view visual force page..

can you please guide me how to give restrict ?

 
Hi Guys,

I'm facing issue is dynamic soql query values wrote from one method. this concept implement everything in controller that controller using wrapper class. 

my scenario is Datefilters concept ,if user gives from date and/or  todate values in page.based on date the table of information is filterd.

Now i'm getting null point argument in displaydetails method. please guide me if you have any idea about wrapper class in SFDC
Before filter Displaying Table :

User-added image

after filter displaying Table::

User-added image
Hi Everyone,

My Scenario is create two fields
product category” as the first lookup(Product2) and then the “Product Name/Code” as the second lookup(Product2) into Child Object (Request__c).

Note:  here main problem is reffering same Parent Object(Product2) in Child Object

Here my client expecting first lookup user going to select perticuler Category 

Product Category 
Samsung
IPHONE
SONY

Samsung :(user Clicks First lookup values is Samsung in second lookup need to display some dependeny mentioned below )

Product  Name/code(Lookup)
S-3652
S-2564
S-1234

IPHONE:(user Clicks First lookup values is IPHONE in second lookup need to display some dependeny mentioned below )

Product name/code(Lookup)
I6
I7
I8

Sony:(user Clicks First lookup values is Sony in second lookup need to display some dependeny mentioned below )

Product Name/code(Lookup)
Sony-1234
Sony-5664
Sony-4568

I'm implemented same functionlity using picklist dependency its working fine but my client expecting above scenario. 

Can you please guide me how to achive this scenrion in Salesforce .


PFA

User-added image
Hi All, 

My Requirement is System Administrator going to merge two Different  loyalty records in Loyalty application. 


Contact- Parent Object
Loyalty- Child Object 

Loyalty tier : Formula filed (

statement 1: =>150k,tier1 
statement 2:   >=85k && <150k ,tier2
statement 3:  < $85K,tier 3 )


1.  search  criteria (Email or LoyaltyId or Contact name or Homephone or MobilePhone or etc)
User-added image


.if i search with mail or mobile number or contact name in contact object . then i get child of loyalty records in table. 

Search any  two(or more) Contacts merged manually ,The loyalty object should be merged as well ,using the same logic that is currently in place for merging Contacts.


Merging Fields in Record::

Loyalty Sales Inclusion Value:    saleslifetimevalue+ loyaltysalesinclusionvalue, ex : 0 + $95000= $ 95000 


Saleslifetimevalue=      Saleslifetimevalue (Record 1 )+ Saleslifetimevalue (Record 2 ) = $73000 + $ 95000 = $ 163000


Loyalty Life Time Value:     Saleslifetimevalue+ loyaltysalesinclusionvalue=$ 163000 + 0 = $ 163000




PageBlock Table:
User-added image



Scope:

New Contact: When a customer buys an Audi vehicle for the first time, the system should generate a unique Loyalty ID (LID) for the contact and the retail price of the vehicle shall determine the Loyalty tier for the new contact.

Existing Contact: When an existing customer purchases a 2 nd or subsequent Audi vehicles the retail price of the vehicle will increase the Loyalty life time spend of the contact which may lead to increase in their Loyalty tier based on the total lifetime spend of the contact.

Merging existing Contacts: When two (or more) Contacts are merged manually, the Loyalty Objects

should be merged as well, using the same logic that is currently in place for merging Contacts.



Loyalty Inclusion : Loyalty Inclusion nothing but checkbox validation .
                             if you give checkbox =  true means the record is merged to other record.
                              else checkbox =  false means the record is override based on other record. 

 A Checkbox in Loyalty object traced to the checkbox in Loyalty application identifying 





Scenario1 :  A new customer purchases a vehicle for $73,800 – new contact created:

Contact name:  Sasidhar

Loyalty Id : AC00061 (unique Id)

SaleslifeTime Value : $90,000

Loyalty Sales Inclusion Value: $0


Loyalty Life Time Value :  Sales Lifetime Value + Loyalty Sales Inclusion Value = $90,000+ $0 = $90,000


Loyalty tier determined: Tier 2 (< $85K)


Purchased Vehicles = 1


Purchased Vehicles Inclusion = 0


Loyalty Vehicles: Purchased Vehicles + Purchased Vehicles Inclusion = 1 + 0 = 1


Loyalty Overwrite date = Null



Scenario 2: Existing customer purchased a 2 nd vehicle for $90,000 -existing contact:


Contact name:  Sehwag

Loyalty Id : AC00050 (unique Id)

Sales Lifetime Value: $73,800 + $90,000= $163,800


Loyalty Sales Inclusion Value: $0 + SaleslifeTime Value : $73,800


Loyalty Lifetime Value: Sales Lifetime Value + Loyalty Sales Inclusion Value = $163,800+ $0 = $163,800

4. Loyalty tier determined: Tier 1 (<= $150K)

5. Purchased Vehicles = 2

6. Purchased Vehicles Inclusion = 0

7. Loyalty Vehicles: Purchased Vehicles+  Purchased Vehicles Inclusion = 2 + 0 = 2
8 . Loyalty Overwrite date = Null



Finally Expecting result is : 

User-added image
 
Hi Guys,

I'm facing issue is dynamic soql query values wrote from one method. this concept implement everything in controller that controller using wrapper class. 

my scenario is Datefilters concept ,if user gives from date and/or  todate values in page.based on date the table of information is filterd.

Now i'm getting null point argument in displaydetails method. please guide me if you have any idea about wrapper class in SFDC
Before filter Displaying Table :

User-added image

after filter displaying Table::

User-added image
Hi Everyone,

My Scenario is create two fields
product category” as the first lookup(Product2) and then the “Product Name/Code” as the second lookup(Product2) into Child Object (Request__c).

Note:  here main problem is reffering same Parent Object(Product2) in Child Object

Here my client expecting first lookup user going to select perticuler Category 

Product Category 
Samsung
IPHONE
SONY

Samsung :(user Clicks First lookup values is Samsung in second lookup need to display some dependeny mentioned below )

Product  Name/code(Lookup)
S-3652
S-2564
S-1234

IPHONE:(user Clicks First lookup values is IPHONE in second lookup need to display some dependeny mentioned below )

Product name/code(Lookup)
I6
I7
I8

Sony:(user Clicks First lookup values is Sony in second lookup need to display some dependeny mentioned below )

Product Name/code(Lookup)
Sony-1234
Sony-5664
Sony-4568

I'm implemented same functionlity using picklist dependency its working fine but my client expecting above scenario. 

Can you please guide me how to achive this scenrion in Salesforce .


PFA

User-added image