Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to modify liferay addUser method to autoincrement userId ??
How to modify liferay addUser method to autoincrement userId.......
Um, that's done already...
Hi Piyush,
If you see UserLocalServiceUtil.addUser(so many params here), you dont need to specify the userId in the params.
Liferay automatically increments the id and adds the user to the DB.
Thanks,
Siby
If you see UserLocalServiceUtil.addUser(so many params here), you dont need to specify the userId in the params.
Liferay automatically increments the id and adds the user to the DB.
Thanks,
Siby
Siby Mathew:
Hi Piyush,
If you see UserLocalServiceUtil.addUser(so many params here), you dont need to specify the userId in the params.
Liferay automatically increments the id and adds the user to the DB.
Thanks,
Siby
but in addUser method companyId give null pointer exception how to resolve them.........
Hi Piyush,
You will get companyId using following ways
1) themeDisplay.getCompanyId();
2) Company company = CompanyLocalServiceUtil.getCompanyByWebId("liferay.com");
long comapnyId = company.getCompanyId();
You will get companyId using following ways
1) themeDisplay.getCompanyId();
2) Company company = CompanyLocalServiceUtil.getCompanyByWebId("liferay.com");
long comapnyId = company.getCompanyId();
Tanaji M. Londhe:
Hi Piyush,
You will get companyId using following ways
1) themeDisplay.getCompanyId();
2) Company company = CompanyLocalServiceUtil.getCompanyByWebId("liferay.com");
long comapnyId = company.getCompanyId();
Problem is Not Resolve by both methods of get a companyId......
How do you add the user programmatically share that code.
I have done this using following code
http://tanajilondhe.blogspot.in/2013/01/liferay-add-user-programmatically.html
I have done this using following code
http://tanajilondhe.blogspot.in/2013/01/liferay-add-user-programmatically.html
Community
Company
Feedback