Default data for detail pages
You can use a formula in Operations and Regulations to define default data to show when users open detail pages in Rhythm for Civics.
To define custom data for detail pages use the CustomPortalDefaultDataNew event in the Workflow Manager. This event is available on service request object (CRM.ServiceRequest), and on these CDR application objects:
CDR.Building.BuildingApplicationCDR.BusinessLicense.LicenseApplicationCDR.Planning.PlanningApplicationCDR.Project.ProjectApplicationCDR.TradeLicense.TradeLicenseCDR.UseApplication.UseApplication
This example sets default values for the detail page on a noise complaint service request. If the service request type is Noise, the formulas sets these default values:
- The noise type is set to Amplified.
- The severity is set to Medium.
- The incident date is set to today's date.
- The value of the Recurring check box is set to Yes.
- The estimated duration is set to 30 minutes.
- The comments will show a prompt asking for the date, time, and duration of the disturbance.
- A blank row is added to the Witness grid.
' =============================================================================
' CustomPortalDefaultData — Service Request Type: NOISE (noise complaint)
' Detail Page: InforClient.SR2601.NoiseComplaintInfo
' Seeds suggested values only; the portal applies them non-destructively.
' =============================================================================
Dim res As Hansen.Core.Result = Result.Success
If oServiceRequest.RequestType.RequestType = "NOISE" Then
' Attach the detail page to the transient SR (GetInstanceFromParent pattern)
Dim dp = InforClient.SR2601.NoiseComplaintInfo.GetInstanceFromParent(oServiceRequest, res)
' --- Coded / Code-Definition dropdown -> set the .Code ---------------------
' Extractor emits this as { "Code": "AMPLIFIED" } — the shape the portal consumes.
dp.NoiseType.Code = "AMPLIFIED"
' --- Enumeration dropdown -> set the enum member ---------------------------
' Extractor emits the enum as a PLAIN string (e.g. "Medium"), not { Code }.
dp.Severity = Hansen.CRM.ServiceRequest.NoiseSeverity.Medium
' --- Plain scalar fields ---------------------------------------------------
dp.LocationDescription = "Reported near the intersection; verify exact address."
dp.IsRecurring = True
dp.IncidentDate = ServerApplication.GetDateNow()
' --- Numeric field --------------------------------------------------------
' Seed a sensible value only. Default data does NOT validate — if this field
' must be non-negative, enforce that via the field's validation /
' CustomPortalValidateDetails, not here.
dp.EstimatedDurationMinutes = 30
' --- Comments -------------------------------------------------------------
dp.Comments = "Please include date, time, and duration of the disturbance."
' --- Nested grid (e.g. witnesses) -----------------------------------------
' NewChild() creates the row AND adds it to the grid collection (NewChild(true)).
Dim witness = dp.NoiseWitnessGrid.NewChild()
witness.WitnessName = ""
witness.ContactNumber = ""
End If