Case Management formula
This formula is used to search for case managed requests and history requests related to a particular property.
Dim sProductFamily as string Dim sTableName as string
Dim res as Hansen.Core.Result
Dim addr as Hansen.Property.IAddress
sProductFamily = "CRM"
sTableName = "ServiceRequest"
' Add to collection of selects
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".ServiceRequestNumber" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.AddressKey" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.StreetNumber" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.StreetName" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.Suffix.Code" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.City" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.State" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Address.ZIP" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".Priority.Code" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".RequestType.RequestType" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".RequestType.RequestDescription" ) )
colSelect.Add( new IDOperativeByCommonID( sProductFamily, sTableName + ".InitiatedDateTime" ) )
' Add to collection of wheres
' Service request type
colWhere.Add( new IDOperativeByCommonID( sProductFamily, sTableName +
".RequestType.RequestType", ComparisonOperator.Equal, "CASEMANAGE"))
colWhere.Add( new IDOperativeByCommonID( sProductFamily, sTableName +
".IsResolved", ComparisonOperator.Equal, "N"))
' Create Schema Dim oLoader as SchemaLoader
oLoader = ServerApplication.GetSchemaLoader ( oServiceRequest.UserInfo.GetProvider() )
res = oLoader.GenerateSchemaByCommonID( sProductFamily, sTableName + ".RequestType", oSchema )
if
res.IsSuccess
then
res= oLoader.AddToSchemaByCommonID( sProductFamily, sTableName + ".Priority", oSchema )
end if
if
res.IsSuccess
then
addr = ServerApplication.NewComponent( "Hansen.Property.Address", oServiceRequest.UserInfo )
res = addr.AddTablesToSchema( oLoader, sProductFamily, sTableName + ".Address", oSchema )
end if
return res