function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SKumar SFDCSKumar SFDC 

Pass/Access one class return values into another class

Dear Folks, 

Here I have 2 classes created - Input_Class & Leads.
Input_Class - Returns lead values, where as Leads - Inserts records.

Issue:
The Issue is How should I get Input_Class return values into Lead class? here is the code which I try to write..

Input_Class======================>>>>>>>>>>>>>>>>
public static with sharing class Input_Class {    
    public static list<lead> lead_input(){
        list<lead> ld = new list<lead>();
        ld.add(new lead(LastName='Kannamma',Company='Kanni tech',Status='Open - Not Connected'));
      return ld;
    }
}

Leads Class =================================>>>>>>>>>
public static with sharing class Leads {    
    public static void Lead_create(){
        Input_Class.lead_input(); // How could I get above inputclass ld values here?????????????????
        update ld;            
    }
}
Himanshu ParasharHimanshu Parashar
Hi,

This will be your lead class
 
public static with sharing class Leads {    
    public static void Lead_create(){
        List<lead> lstLead=new list<lead>();
        lstLead=Input_Class.lead_input(); // you will have to assign that in a list
        //write you logic on return list.
        update ld;            
    }
}


Thanks,
Himanshu