Custom Views Enhancement
NB This applies to versions 2024.10.7.440 onwards
Usage
To use the parameterised custom views create a custom view following normal procedure, but utilise any of the parameters from the table below.
When a user chooses a custom view from the Lead or Contract browser AdminBase analyses the SQL of the custom view and matches the parameter names to the ones below. If any of these parameters are used it shows the relevant dialog and populates the parameters with the value chosen.
NB. Date parameters must be used in conjunction. i.e. If you use a LDateFrom parameter you must also use a LDateTo parameter.
Example
The below Contract view shows contracts where the InstallationManager is the current user and where the date fitted is in a range selected by the user upon view selection.
Make sure to use Lead parameters with Lead view and Contract parameters with Contract views. i.e. LDateFrom & LDateTo vs CDateFrom & CDateTo
SELECT distinct C1.ContractNo, C1.Name AS CustName, C1.SoldBy, C1.SiteAddress, C1.OfficeRef, C1.DateFitted, C1.Address, C1.DisplayRef, C1.FittingPostcode, C1.CustNo, C1.ProjectNo, C1.ContractDate, C1.TelephoneNumbers, C1.LeadSource, C1.SalesArea, C1.ContractCancelled, C1.DateCancelled, C1.InstallationManager, C1.PaymentMethod, C1.OfficeRef2, C1.ContBal, C1.ContNet, C1.ContGross FROM CCR C1 WHERE (C1.DateFitted IS NULL) and InstallationManager = :currentuser and DateFitted between :CDateFrom and :CDateTo
Parameters
Parameter Name | Form name used |
---|---|
LDateFrom & LDateTo | fmPlainDateRange (Using tag=1 (This is so if they use week numbers all gets computed correctly)) |
CDateFrom & CDateTo | fmPlainDateRange (Using tag=2) |
SelectedDate | fmSingleDate |
Salesperson | fmSelectSalesperson |
InstallManager, Surveyor, Fitter | fmSelectPersonnel |
SalesArea | fmSelectSalesArea (You’ll need to make Label1.Visible=False) |
LastWeekFrom & LastWeekTo | Compute |
LastMonthFrom & LastMonthTo | Compute |
ThisWeekFrom & ThisWeekTo | Compute |
ThisMonthFrom & ThisMonthFrom | Compute |
NextWeekFrom & NextWeekTo | Compute |
NextMonthFrom & NextMonthTo | Compute |
CurrentUser | Compute (Ini) |
ContractType | fmContractTypeSelection (Hide the leave blank for all) |
RemedialType | fmSelCallType (Although this has Inst Mgr on so may need a new one) |
QuoteType | fmSelectLookupDialog (Tag 59) |
SelectedText | fmSimpleReportQuery |
ReportingGroup | fmSelectLookupDialog (Tag 61) |
EventCategory | fmGenericSelectLookupDialog |
NB This applies to versions 2024.10.7.440 onwards