
public class FristPortalUserCreatedDate{
public static void updateFirstPortalUser(List<User> newUsers) {
for (Integer i = 0; i < newUsers.size(); i++) {
List<User> ExistinUsers = [select id,AccountId,Name From User where AccountId=:newUsers[i].AccountId];
if(ExistinUsers.isEmpty()){
Update new Account(Id=newUsers[i].AccountId,Portal_user_created_date__c = system.Today());
}
}
}
}
1 answer
This Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at https://developer.salesforce.com where the forums and participants are geared toward programming troubleshooting and support.