• Gunwinder 11
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Experts, 

I am a novice to Apex and having trouble to build a class wherein I want to fetch values from one list to another. 
 
List<User> UsersList = [select id,contactid,Gold_Partner_User__c,Customer_Portal_User__c FROM USER  WHERE isActive=TRUE AND Customer_Portal_User__c = TRUE];	
        
List<contact> ContactList =[Select id,Customer_Portal_Lic_assigned__c 
FROM contact WHERE ID IN : UsersList AND Customer_Portal_Lic_assigned__c=FALSE];
background: 

On USER object, Gold_Partner_User__c and Customer_Portal_User__c are formula fields which identify the type of license assigned. 

Our customers who do not have access to USER object, I have created Customer_Portal_Lic_assigned__c on contact object so that a contact list view / report could be created for them.
 
I want to build a scheduled apex job that identifies contacts where users who are mapped with a customer portal license are identified and the related contact object is updated with the checkbox. 

Kindly suggest how should be best done.
Experts, 

I am a novice to Apex and having trouble to build a class wherein I want to fetch values from one list to another. 
 
List<User> UsersList = [select id,contactid,Gold_Partner_User__c,Customer_Portal_User__c FROM USER  WHERE isActive=TRUE AND Customer_Portal_User__c = TRUE];	
        
List<contact> ContactList =[Select id,Customer_Portal_Lic_assigned__c 
FROM contact WHERE ID IN : UsersList AND Customer_Portal_Lic_assigned__c=FALSE];
background: 

On USER object, Gold_Partner_User__c and Customer_Portal_User__c are formula fields which identify the type of license assigned. 

Our customers who do not have access to USER object, I have created Customer_Portal_Lic_assigned__c on contact object so that a contact list view / report could be created for them.
 
I want to build a scheduled apex job that identifies contacts where users who are mapped with a customer portal license are identified and the related contact object is updated with the checkbox. 

Kindly suggest how should be best done.