Parse Request and Build Response
Global Class ClassName
{
//THE PARAMETER NAME MUST BE request ONLY
webservice static SVMXC.INTF_WrapperDef.INTF_PageData
WSName(SVMXC.INTF_WrapperDef.INTF_TargetRecord request)
{
// Describe all objects
SVMXC.INTF_WrapperDef.INTF_PageData pagedata = new SVMXC.INTF_WrapperDef.INTF_PageData();
map<String,Schema.SObjectType> Allobj = new map<String,
Schema.SObjectType>();
map<String, Schema.SObjectType> gd = new Map<String,
Schema.SObjectType>();
gd = Schema.getGlobalDescribe();
if(gd.size() > 0)
{
for(Schema.SObjectType s : gd.values())
{
Schema.DescribeSObjectResult result = s.getDescribe();
Allobj.put(result.getName(), s);
}
}
SVMXC.INTF_ServicesDef def = new SVMXC.INTF_ServicesDef();
// The method below returns the Header Sobject record
Sobject headerSobj = def.INTF_Page_GetHeaderRecord(request, Allobj);
// After getting the Header Sobject record, process it if required
...
// The method below returns the detail Sobject records in a map (Key: Tab Id, Value: List of Sobject records)
map<String,List<Sobject>> detailSobjectMap = new map<String, List<Sobject>>();
detailSobjectMap = def.INTF_Page_GetDetailRecords(request, Allobj);
// Loop through the map to get the list of Sobject records and process them
...
// Call the method below with the processed Header Sobject record and Detail Sobjects map
pagedata = def.INTF_Page_BuildResponse(request, headerSobj, detailSobjectMap);
return pagedata;
}
}
Was this helpful?