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 Access Custom Entity Services In Velocity template - LDS With DXP?
Unable to access Custom Entity Services In Velocity template.
Can any help me out.
Steps
1. Create Service-Builder Module project(CustomEntity)
2. Update The service.xml with Entity Name => Idea
3. Gradle buildService and Deploye
4. Add some master data in Idea Table
5. Add below code in velocity tempalate (With Structure and Tempalate)
#set ($customLocalService = $serviceLocator.findService("CustomEntity.service.IdeaLocalService"))
#set ($number=$customLocalService.getIdeasCount())
$number
CustomEntity.api
CustomEntity.service
above both jars availbale in OSGI Folder
And also added below propoerties in portal-ext.propoerties
velocity.engine.restricted.classes=
velocity.engine.restricted.variables=
freemarker.engine.restricted.classes=
freemarker.engine.restricted.variables=
Actual Result:
$number Showing In UI
Expected Result:
Count of records of the enity should show
Used Below Softwares:
Liferay Development Studio
liferay-dxp-digital-enterprise-7.0-sp6
Patching-Tool: de-69-7010
Can any help me out.
Steps
1. Create Service-Builder Module project(CustomEntity)
2. Update The service.xml with Entity Name => Idea
3. Gradle buildService and Deploye
4. Add some master data in Idea Table
5. Add below code in velocity tempalate (With Structure and Tempalate)
#set ($customLocalService = $serviceLocator.findService("CustomEntity.service.IdeaLocalService"))
#set ($number=$customLocalService.getIdeasCount())
$number
CustomEntity.api
CustomEntity.service
above both jars availbale in OSGI Folder
And also added below propoerties in portal-ext.propoerties
velocity.engine.restricted.classes=
velocity.engine.restricted.variables=
freemarker.engine.restricted.classes=
freemarker.engine.restricted.variables=
Actual Result:
$number Showing In UI
Expected Result:
Count of records of the enity should show
Used Below Softwares:
Liferay Development Studio
liferay-dxp-digital-enterprise-7.0-sp6
Patching-Tool: de-69-7010
Hi All, Can any one help me out.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™