Issue - If below trace is found when trying to add or edit request life cycle, request custom views, request business rules or request custom trigger, then following procedure can be followed
Reason - Issue occurs if service category and service additional fields related tables like servicemetatable, dynamic tables contains orphan entries for that particular service category
Error traces : [16:54:33:550]|[04-12-2023]|[com.manageengine.sdpod.v3api.JSONDOConverter]|[SEVERE]|[56]: error while forming dynamic fields..|
java.lang.Exception: No Service table found for the service 4801 ----> Service category ID
at com.manageengine.servicedesk.utils.ServiceCatalogUtil.getServiceTable(ServiceCatalogUtil.java:1688)
at com.manageengine.servicedesk.utils.ServiceCatalogUtil.getServiceTable(ServiceCatalogUtil.java:1634)
at com.manageengine.servicedesk.utils.ServiceCatalogUtil.getAllServiceTablesUsingMDHSettings(ServiceCatalogUtil.java:5814)
at com.manageengine.servicedesk.utils.ServiceCatalogUtil.getAllServiceTablesUsingMDHSettings(ServiceCatalogUtil.java:5798)
at com.manageengine.sdpod.v3api.handlerimpl.WorkOrderHandler.getDynamicFields(WorkOrderHandler.java:1038)
at com.manageengine.servicedesk.v3api.impl.ApiImpl.getDynamicFields(ApiImpl.java:358)
at com.manageengine.sdpod.v3api.handlerimpl.UDFValueHandler.getDynamicFields(UDFValueHandler.java:321)
at com.manageengine.sdpod.v3api.handlerimpl.UDFValueHandler.getDynamicField(UDFValueHandler.java:205)
at com.manageengine.sdpod.v3api.entity.EntityFields.getFieldByName(EntityFields.java:149)
at com.manageengine.sdpod.v3api.entity.EntityLocator.getURIParseResult(EntityLocator.java:159)
at com.manageengine.sdpod.v3api.APIRequest.getInstance(APIRequest.java:210)
at com.manageengine.servicedesk.sdpapi.v2.servlet.SDPAPIV2Servlet.handleCall(SDPAPIV2Servlet.java:269)
at com.manageengine.servicedesk.sdpapi.v2.servlet.SDPAPIV2Servlet.doOperation(SDPAPIV2Servlet.java:228)
at com.manageengine.servicedesk.sdpapi.v2.servlet.SDPAPIV2Servlet.doGet(SDPAPIV2Servlet.java:95)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
Queries to be executed directly from db:1. select * from servicemetatable where serviceid =4801;
2. select * from dynamictables where tablename in ('ServiceReq_4801','SServiceReq_4801','ARC_ServiceReq_4801');
3. select * from tabledetails where table_name in ('ServiceReq_4801','SServiceReq_4801','ARC_ServiceReq_4801');
4. select * from columndetails where table_id not in (select table_id from tabledetails);
5. select * from servicereq_4801;
6. select * from sservicereq_4801;
7. select * from arc_servicereq_4801;
8. select * from servicedefinition where serviceid=4801;
Replace '
4801' with service category id which is found in error trace
To resolve the issue:
Scenario 1 : If query 5 to 7, throws error like no table is present and if query 1 to 4 contains data, then it is safe to delete those orphan entries using below queries
1. delete from servicemetatable where serviceid =4801;
2. delete from dynamictables where tablename in ('ServiceReq_4801','SServiceReq_4801','ARC_ServiceReq_4801');
3. delete from tabledetails where table_name in ('ServiceReq_4801','SServiceReq_4801','ARC_ServiceReq_4801');
4. delete from columndetails where table_id not in (select table_id from tabledetails);
From query 8, we'll get the service category name for which issue occurs. After executing the above delete query, we can just dummy update this service category to resolve the issue