You need to sign in to do that
Don't have an account?
Code to update Contact via Execute Anonymous Window not producing results
I have created a field on the Contact object Active_Community_User__c, to be checked when we set up a Community user, and unchecked when we deactivate the Community user.
I need to update this field on existing Community users. Logically that would be best done through the Execute Anonymous window, but the code I have written isn't producing results.
The code appears to execute without error, but nothing changes.
Help?
I need to update this field on existing Community users. Logically that would be best done through the Execute Anonymous window, but the code I have written isn't producing results.
The code appears to execute without error, but nothing changes.
Help?
List<User> userList = [ select user.Id, user.Contact.Active_Community_User__c from user where user.IsActive = True and (user.Profile.Name ='zConnect Community User' or user.Profile.Name = 'zConnect Community User Login')]; for(User us : userList) { us.Contact.Active_Community_User__c = True; } update userList;
Hopefully that helps,
Matt Kowalski
All Answers
Hopefully that helps,
Matt Kowalski
Matt that code worked except for a typo and some stray tabs. Here it is in final format: