留言板
Create an organization
I need some help creating a new organization
Everything I have found and tried takes an orgId, I am looking for something like new Organization() that or .create() that creates one with the next available id.
I tried OrganizationUtil.create(0) and OrganizationUtil.create(-1) and a new Org was created with either id 0 or even -1
Everything I have found and tried takes an orgId, I am looking for something like new Organization() that or .create() that creates one with the next available id.
I tried OrganizationUtil.create(0) and OrganizationUtil.create(-1) and a new Org was created with either id 0 or even -1
You should use OrganizationLocalServiceUtil.addOrganization method.
thanks... but I already tried that and takes either user or organization object. The first one is ok but I need this for a "company admin" portlet, do not want to add the current user to the organization, just create one with no users. The second one takes an existing org and I can't do Organization = new Organization()
OrganizationLocalServiceUtil.addOrganization(userId, parentOrganizationId, name, type, recursable, regionId, countryId, statusId, comments, serviceContext)
OrganizationLocalServiceUtil.addOrganization(organization)
OrganizationLocalServiceUtil.addOrganization(userId, parentOrganizationId, name, type, recursable, regionId, countryId, statusId, comments, serviceContext)
OrganizationLocalServiceUtil.addOrganization(organization)