I am looking for a way to create a user within Box.com if the user does not exist in Box.com after a Salesforce Community User record is created.

How can I create a user in box.com if one does not exists?

What I have tried, but couldn't find out how to get it to work. It seems to not create any errors and errors don't show up in the logs.

trigger UserCreate on User(after create) {
  BoxApiConnection boxApi = new BoxApiConnection('accessToken');
  box.Toolkit boxToolkit = new box.Toolkit();
  for(User usr : Trigger.new) {
    String name = usr.FirstName;
    if(!BoxUser.getUser(name)) {
      BoxUser.createAppUser(boxApi, 'First_Last');
  • Have you checked with Box.com support? – gNerb Jan 14 '20 at 18:52

boxToolkit.commitChanges() could be an asynchronous callout, so any returned errors are likely several seconds later and included in a different log.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.