+ Start a Discussion
Jyosi jyosiJyosi jyosi 

Need to pass the values from class to other

I Have class where i am writing all the queries and calling into the other class .
I need to the get the custom setting values from class B to class A and assign to variable in class A.
Here is the code in Class B.
public String ABC()
    {
     List<User> ListUserValues= getCurrentUserInfoById(userinfo.getUserId());
        for(User UserValues :ListUserValues)
        {
          if(UserValues.Location__c=='US')
          {
            AuthenticationSettings__c GLIntegration = AuthenticationSettings__c .getAll().get('SAP_Universal');
             UserName=Integration.User__c;
             Password=ntegration.Password__c;
             EndPoint=ntegration.EndPoint__c;
             UserDet = UserName + ':' + Password;
          }
         }

I need to get UserDet and endpoint variable in Class A.

Can you help me how to get the value into class A.

Thanks for help

Regards,
Jyo
bk sbk s
is it not like return UserDet; will solve your problem ? unless i am missing something big here.

public class A{
  
public void method1(){

   B  b = new B();
   string customsettingValue = b.ABC();
  //if you write it as static you could do following,

 string customersettingValue = B.ABC();


}


}