I'm trying to deserialize a received user record on a JSON format. TO achieve this I'm using JSON.deserialize() but when I specify the User class the compiler throws the following error:
Save Error: variable does not exist User.class
This is my code:
@RemoteAction
global static String updateTotalAccompByUserId(String userJSON, String userCategory, String totalAccomp, String currentQuarter, String currentYear){
...
User user = (User) JSON.deserialize(userJSON, User.class); /*ERROR*/
system.debug('%%% user: ' + user);
...
}
Type.forName('User')
alternative?