function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NikithaNikitha 

Method does not exist or incorrect signature: void createUser(List<User>) from the type RestApiUsingUser

Hi new to salesforce I'm trying validation using trigger I'm getting above err
 my class code is
 @HttpPost
   global static void createUser(List<User> userList,String Firstname,String Lastname,  String alias,String ProfileId,String Email,
                                String   TimeZoneSidKey,String LanguageLocaleKey,String CommunityNickname,
                               String EmailEncodingKey,String LocaleSidKey,String UserName)
   {
       
       Profile customProfile = [Select id From profile Where Name ='Custom Profile' Limit 1];
       for(User newUser : userList){
        newUser.Firstname = firstname;
        newUser.Lastname = lastname;
        newUser.CommunityNickname = CommunityNickname;
        newUser.Email = email;
       if(String.isBlank(newUser.Email))
       {
           newUser.addError('Enter Email ');
       }
        newUser.Alias = alias;
        newUser.Username = username;
        newUser.ProfileId = customProfile.id ;
        newUser.TimeZoneSidKey = TimeZoneSidKey;
        newUser.LanguageLocaleKey = LanguageLocaleKey;
        newUser.EmailEncodingKey = EmailEncodingKey;
        newUser.LocaleSidKey = LocaleSidKey;
        insert newUser;
                                 
    }
   }
 please help me
 
NikithaNikitha
and in trigger
trigger FieldMandatoryTrigger on User (before insert) {
    If(Trigger.isBefore && Trigger.isInsert){
        RestApiUsingUser.createUser(Trigger.new);     <- Error msg
    }
}
I have err in line 3