i am try to display the organization list in liferay but it show exception

Jamie Sammons, modified 2 Years ago. New Member Posts: 2 Join Date: 5/11/23 Recent Posts

com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=20096, name=com.liferay.portal.kernel.model.Organization, primKey=602, scope=4}

thumbnail
Olaf Kock, modified 2 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

In case you're expecting us to locate a problem with the code that you use to display the list, we'd need to see it (and we'd need to know which exact version it's running on)

Jamie Sammons, modified 2 Years ago. New Member Posts: 2 Join Date: 5/11/23 Recent Posts


    public long addOrganization(long userId, String name,long regionId,long countryId, String location,String company_address,String treePath, ServiceContext serviceContext) throws PortalException {

            User user = userLocalService.getUser(userId);

           

            long organizationId = counterLocalService.increment(Organization.class.getName());
            
           

            Organization organization = organizationPersistence.createOrganization(organizationId);
            long parentOrganizationId = organization.getParentOrganizationId();
        
            organization.setUuid(serviceContext.getUuid());
            organization.setCompanyId(serviceContext.getCompanyId());
            organization.setUserId(userId);
            organization.setUserName(user.getFullName());
            organization.setCreateDate(serviceContext.getCreateDate(new Date()));
            organization.setModifiedDate(serviceContext.getModifiedDate(new Date()));
            organization.setName(name);
            organization.setType(OrganizationConstants.TYPE_ORGANIZATION);
            organization.setRegionId(regionId);
            organization.setCountryId(countryId);
            organization.setComments("");
            organization.setExpandoBridgeAttributes(serviceContext);
            organization.setRecursable(true);
            organization.setStatusListTypeId(12017);
            organization.setTreePath("/608/");
            organizationPersistence.updateOrganization(organization);

            return organization.getOrganizationId();
        }

 

this is the code i try to add the organization from custom portlet.Sucessfully its added but i try to display that it show error.