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
RE: Custom table Column value Site wise auto increment by 1
Hi All,
I have a requirement custom table Column value Site wise auto increment by 1.
for example table name Example and Column A . now i have site A,B when adding the Record in site A for every row Column A to increse by 1 like 1,2,3,4... Ect. same scenario for site B it want to stat again from 1,2,3,4 ...ect.
Thanks in Advance
Thanks,
Srini
I have a requirement custom table Column value Site wise auto increment by 1.
for example table name Example and Column A . now i have site A,B when adding the Record in site A for every row Column A to increse by 1 like 1,2,3,4... Ect. same scenario for site B it want to stat again from 1,2,3,4 ...ect.
Thanks in Advance
Thanks,
Srini
Hi ,You can use Liferay CounterLocalserviceUtil and do increment by 1 .
CounterLocalserviceUtil.increament("SITEA", 1)/CounterLocalserviceUtil.increament("SITEB, 1);
You need to set in portal.properties alsocounter.increment.SITEA=1
counter.increment.SITEB=1
Thank you it's worked perfectly what i am expected.
Mohammed Yasin:
Hi ,You can use Liferay CounterLocalserviceUtil and do increment by 1 .You need to set in portal.properties alsoCounterLocalserviceUtil.increament("SITEA", 1)/CounterLocalserviceUtil.increament("SITEB, 1);
counter.increment.SITEA=1
counter.increment.SITEB=1
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™