问题描述
我一直在努力,但没有成功(我是编码新手)。我正在尝试将此代码用于 obfuscateUser 并将其更新为以下内容:
非常感谢任何帮助!谢谢!!
public class UserManagementController{
public List <User> users {get; set;}
public UserManagementController()
{
Profile p = [select id from profile where name = 'Customer Community User'];
users = [select username, id from User where profileId=:p.id AND isactive=true];
}
//Use method with extreme caution. Data can't be recovered.
@invocableMethod(label='User Management' description='Obfuscate User data and more')
static public void obfuscate(List<User> users)
{
String uid = ApexPages.currentPage().getParameters().get('uid');
if(uid == null)
return;
User u = [select contactId from user where id=:uid];
System.UserManagement.obfuscateUser(uid);
if(u.contactId != null)
{
List <Contact> contacts = [select id from Contact where id=:u.contactId LIMIT 1];
if (contacts == null || contacts.isEmpty() == true)
return;
delete contacts;
}
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)