I am a little bit new to salesforce & APEX AND need help with the following,
I want to create bulk community users & then assign them to existing accounts through APEX code/classes (for testing one of my applications)
However, I learned that to create or link a community user to an account, a contact should be available and linked to the account as well. As the user is linked to a contact directly, not account. Correct me if I am wrong.
So, how do I create new interlinked contacts & community users AND then assign them to my existing accounts, (Accounts + Contacts + Users > created using APEX)
is the sequence different: first create contact and link it to an account AND then create a user & link it to that contact?
Also, what are required fields to create a community user?
I am badly stuck, please help out and post any questions or queries for better understanding my problem. Any code or concepts etc. would be highly appreciated.